[PATCH] am: handle stray $dotest directory case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following bug has been observed since rr/rebase-autostash:

  $ git am  # no input file
  ^C
  $ git am --abort
  Resolve operation not in progress, we are not resuming.

This happens because the following test fails:

  test -d "$dotest" && test -f "$dotest/last" && test -f "$dotest/next"

and am precludes the possibility of a stray $dotest directory
existing (when $dotest/{last,next} are not present).

Fix the bug by checking for a stray $dotest directory explicitly and
removing it on --abort.

Reported-by: Junio C Hamano <gitster@xxxxxxxxx>
Signed-off-by: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
---
 git-am.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/git-am.sh b/git-am.sh
index 1cf3d1d..f46a123 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -506,6 +506,11 @@ then
 	esac
 	rm -f "$dotest/dirtyindex"
 else
+	# Possible stray $dotest directory
+	if test -d "$dotest" && test t = "$abort"; then
+		clean_abort
+	fi
+
 	# Make sure we are not given --skip, --resolved, nor --abort
 	test "$skip$resolved$abort" = "" ||
 		die "$(gettext "Resolve operation not in progress, we are not resuming.")"
-- 
1.8.3.1.379.ged35616

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]