diff options
author | Joey Hess <joey@kitenet.net> | 2013-08-01 17:30:47 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-08-01 17:30:47 -0400 |
commit | b93d5c83cb1b9089589dd08a854315b92a2533d0 (patch) | |
tree | 1d708254e62195c74ea76a9da0030367e336225c /Utility | |
parent | 7de194763bfdb67985e702f9821b482c76f9b474 (diff) |
Slow and ugly work around for bug #718517 in git, which broke git-cat-file --batch for filenames containing spaces.
This runs git-cat-file in non-batch mode for all files with spaces.
If a directory tree has a lot of them, and is in direct mode, even "git
annex add" when there are few new files will need a *lot* of forks!
The only reason buffering the whole file content to get the sha is not a
memory leak is that git-annex only ever uses this on symlinks.
This needs to be reverted as soon as a fix is available in git!
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Process.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Utility/Process.hs b/Utility/Process.hs index 3a8677fa3..590124289 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -25,6 +25,7 @@ module Utility.Process ( withHandle, withBothHandles, withQuietOutput, + withNullHandle, createProcess, startInteractiveProcess, stdinHandle, @@ -241,12 +242,15 @@ withQuietOutput :: CreateProcessRunner -> CreateProcess -> IO () -withQuietOutput creator p = withFile devnull WriteMode $ \nullh -> do +withQuietOutput creator p = withNullHandle $ \nullh -> do let p' = p { std_out = UseHandle nullh , std_err = UseHandle nullh } creator p' $ const $ return () + +withNullHandle :: (Handle -> IO a) -> IO a +withNullHandle = withFile devnull WriteMode where #ifndef mingw32_HOST_OS devnull = "/dev/null" |