lookupkey: Allow using --ref in a bare repository.
This commit is contained in:
parent
e2b7895cbc
commit
242c525659
4 changed files with 22 additions and 4 deletions
|
@ -18,6 +18,7 @@ git-annex (10.20240831) UNRELEASED; urgency=medium
|
||||||
* The config versioning=true is now reserved for use by versioned special
|
* The config versioning=true is now reserved for use by versioned special
|
||||||
remotes. External special remotes should not use that config for their
|
remotes. External special remotes should not use that config for their
|
||||||
own purposes.
|
own purposes.
|
||||||
|
* lookupkey: Allow using --ref in a bare repository.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 31 Jul 2024 15:52:03 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 31 Jul 2024 15:52:03 -0400
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import Utility.Terminal
|
||||||
import Utility.SafeOutput
|
import Utility.SafeOutput
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ noCommit $ noMessages $
|
cmd = noCommit $ noMessages $
|
||||||
command "lookupkey" SectionPlumbing
|
command "lookupkey" SectionPlumbing
|
||||||
"looks up key used for file"
|
"looks up key used for file"
|
||||||
(paramRepeating paramFile)
|
(paramRepeating paramFile)
|
||||||
|
@ -35,7 +35,9 @@ optParser = LookupKeyOptions
|
||||||
run :: LookupKeyOptions -> SeekInput -> String -> Annex Bool
|
run :: LookupKeyOptions -> SeekInput -> String -> Annex Bool
|
||||||
run o _ file
|
run o _ file
|
||||||
| refOption o = catKey (Ref (toRawFilePath file)) >>= display
|
| refOption o = catKey (Ref (toRawFilePath file)) >>= display
|
||||||
| otherwise = seekSingleGitFile file >>= \case
|
| otherwise = do
|
||||||
|
checkNotBareRepo
|
||||||
|
seekSingleGitFile file >>= \case
|
||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
Just file' -> catKeyFile file' >>= display
|
Just file' -> catKeyFile file' >>= display
|
||||||
|
|
||||||
|
|
|
@ -37,3 +37,4 @@ git-annex: You cannot run this command in a bare repository.
|
||||||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||||
|
|
||||||
|
|
||||||
|
> [[fixed|done]] --[[Joey]]
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 3"""
|
||||||
|
date="2024-08-30T14:47:41Z"
|
||||||
|
content="""
|
||||||
|
Fixed that.
|
||||||
|
|
||||||
|
It kind of seems like metadata could have an option to get the metadata for
|
||||||
|
a specific ref as well, but since it already has --branch which takes a
|
||||||
|
branch ref, adding a --ref which takes a file ref seems confusing. Maybe
|
||||||
|
--fileref? There are a decent number of other commands that also use
|
||||||
|
parseKeyOptions to support --branch/--key/--all that would also get the new
|
||||||
|
option if it were implemented.
|
||||||
|
"""]]
|
Loading…
Add table
Add a link
Reference in a new issue