diff options
author | Joey Hess <joey@kitenet.net> | 2014-01-13 18:10:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-01-13 18:10:21 -0400 |
commit | 14ce1badd4210ebb2660e0fb22ba4ff7f2986dee (patch) | |
tree | a0eb1548d7d879631cef51266e8f2ee65fa7a66f /Git/Command.hs | |
parent | dd1d8e69d4c190c7bb60d5187f7a889c6fea0d62 (diff) | |
download | git-repair-14ce1badd4210ebb2660e0fb22ba4ff7f2986dee.tar.gz |
merge from git-annex
Diffstat (limited to 'Git/Command.hs')
-rw-r--r-- | Git/Command.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Git/Command.hs b/Git/Command.hs index adcc53b..4c338ba 100644 --- a/Git/Command.hs +++ b/Git/Command.hs @@ -128,9 +128,14 @@ leaveZombie = fst {- Runs a git command as a coprocess. -} gitCoProcessStart :: Bool -> [CommandParam] -> Repo -> IO CoProcess.CoProcessHandle -gitCoProcessStart restartable params repo = CoProcess.start restartable "git" +gitCoProcessStart restartable params repo = CoProcess.start numrestarts "git" (toCommand $ gitCommandLine params repo) (gitEnv repo) + where + {- If a long-running git command like cat-file --batch + - crashes, it will likely start up again ok. If it keeps crashing + - 10 times, something is badly wrong. -} + numrestarts = if restartable then 10 else 0 gitCreateProcess :: [CommandParam] -> Repo -> CreateProcess gitCreateProcess params repo = |