summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-01-13 18:47:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-13 20:04:53 (GMT)
commit8c24f5b022095f4735fcb73364ccae7d97576636 (patch)
tree09cd5d291ff1284d5dc9198b2e03a0b42b662118 /git-rebase.sh
parent24358560c3c0ab51c9ef8178d99f46711716f6c0 (diff)
downloadgit-8c24f5b022095f4735fcb73364ccae7d97576636.zip
git-8c24f5b022095f4735fcb73364ccae7d97576636.tar.gz
git-8c24f5b022095f4735fcb73364ccae7d97576636.tar.bz2
rebase: ignore failures from "gc --auto"
After rebasing, we call "gc --auto" to clean up if we created a lot of loose objects. However, we do so inside an &&-chain. If "gc --auto" fails (e.g., because a previous background gc blocked us by leaving "gc.log" in place), then: 1. We will fail to clean up the state directory, leaving the user stuck in the rebase forever (even "git am --abort" doesn't work, because it calls "gc --auto"!). 2. In some cases, we may return a bogus exit code from rebase, indicating failure when everything except the auto-gc succeeded. We can fix this by ignoring the exit code of "gc --auto". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 1757404..e8b6144 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -176,7 +176,7 @@ You can run "git stash pop" or "git stash drop" at any time.
finish_rebase () {
apply_autostash &&
- git gc --auto &&
+ { git gc --auto || true; } &&
rm -rf "$state_dir"
}