the behavior of git on Windows, which does not end lines with CR
either.
* Windows: Fix CRLF handling in some log files.
+ * lookupkey: Sped up --batch.
-- Joey Hess <id@joeyh.name> Tue, 10 Oct 2023 13:17:31 -0400
-- To support absolute filenames, pass through git ls-files.
-- But, this plumbing command does not recurse through directories.
seekSingleGitFile :: FilePath -> Annex (Maybe RawFilePath)
-seekSingleGitFile file = do
- (l, cleanup) <- inRepo (Git.LsFiles.inRepo [] [toRawFilePath file])
- r <- case l of
- (f:[]) | takeFileName (fromRawFilePath f) == takeFileName file ->
- return (Just f)
- _ -> return Nothing
- void $ liftIO cleanup
- return r
+seekSingleGitFile file
+ | isRelative file = return (Just (toRawFilePath file))
+ | otherwise = do
+ (l, cleanup) <- inRepo (Git.LsFiles.inRepo [] [toRawFilePath file])
+ r <- case l of
+ (f:[]) | takeFileName (fromRawFilePath f) == takeFileName file ->
+ return (Just f)
+ _ -> return Nothing
+ void $ liftIO cleanup
+ return r
### What version of git-annex are you using? On what operating system?
git-annex version: 10.20230126
+
+> [[fixed|done]] --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2023-10-30T18:51:11Z"
+ content="""
+This is due to lookupkey passing each filename through `git ls-files`
+in order to support absolute filepaths input. See
+[[!commit cfdfe4df6c8b3fe46bbc7afcc8274237a5b2ce2a]]
+
+Made it only do that for absolute paths, which should make it at least
+marginally faster than git-annex find. I would not expect it to be much
+faster though, because git-annex find displaying a little more information
+takes negligible CPU time really.
+"""]]