fix absolute filenames fed into --batch and git-annex info

This commit is contained in:
Joey Hess 2020-04-15 16:04:05 -04:00
parent a14168a321
commit 957a87b437
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
14 changed files with 106 additions and 37 deletions

View file

@ -119,7 +119,7 @@ optParser desc = InfoOptions
seek :: InfoOptions -> CommandSeek
seek o = case batchOption o of
NoBatch -> withWords (commandAction . start o) (infoFor o)
Batch fmt -> batchInput fmt Right (itemInfo o)
Batch fmt -> batchInput fmt (pure . Right) (itemInfo o)
start :: InfoOptions -> [String] -> CommandStart
start o [] = do
@ -152,9 +152,11 @@ itemInfo o p = ifM (isdir p)
v' <- Remote.nameToUUID' p
case v' of
Right u -> uuidInfo o u
Left _ -> ifAnnexed (toRawFilePath p)
(fileInfo o p)
(treeishInfo o p)
Left _ -> do
relp <- liftIO $ relPathCwdToFile p
ifAnnexed (toRawFilePath relp)
(fileInfo o relp)
(treeishInfo o p)
)
where
isdir = liftIO . catchBoolIO . (isDirectory <$$> getFileStatus)