summaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-05-12 11:56:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-13 06:20:07 (GMT)
commita1549e1049439386b9fd643fae236ad3ba649650 (patch)
treeda7ab2c30b88d748cd66c7226f89f712e1dd06c2 /git-am.sh
parentf5f758a5df470352ed46863288551f25fe9c7ea7 (diff)
downloadgit-a1549e1049439386b9fd643fae236ad3ba649650.zip
git-a1549e1049439386b9fd643fae236ad3ba649650.tar.gz
git-a1549e1049439386b9fd643fae236ad3ba649650.tar.bz2
am: return control to caller, for housekeeping
We only need to do these two tasks git gc --auto rm -fr "$dotest" ourselves if the script was invoked as a standalone program; when invoked with --rebasing (from git-rebase--am.sh), cascade control back to the ultimate caller git-rebase.sh to do this for us. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-am.sh b/git-am.sh
index ccb854a..1cf3d1d 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -906,5 +906,10 @@ if test -s "$dotest"/rewritten; then
fi
fi
-rm -fr "$dotest"
-git gc --auto
+# If am was called with --rebasing (from git-rebase--am), it's up to
+# the caller to take care of housekeeping.
+if ! test -f "$dotest/rebasing"
+then
+ rm -fr "$dotest"
+ git gc --auto
+fi