git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] am: handle stray $dotest directory case
@ 2013-06-13 14:17 Ramkumar Ramachandra
  2013-06-13 17:09 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Ramkumar Ramachandra @ 2013-06-13 14:17 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

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@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-13 22:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 14:17 [PATCH] am: handle stray $dotest directory case Ramkumar Ramachandra
2013-06-13 17:09 ` Junio C Hamano
2013-06-13 17:33   ` Ramkumar Ramachandra
2013-06-13 18:40     ` Junio C Hamano
2013-06-13 19:07       ` Ramkumar Ramachandra
2013-06-13 22:49         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).