am: tighten a conditional that checks for $dotest
In preparation for a later patch that creates $dotest/autostash in git-rebase.sh before anything else happens, don't assume that the presence of a $dotest directory implies the existence of the $dotest/next and $dotest/last files. Look for them explicitly. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra committed
May 12, 2013 at 17:26 UTC
c30754f188a4f1bcd35d81d898086fea33524bd6
1 file changed
+3
-1
git-am.sh
+3
-1
@@ -446,6 +446,8 @@ done
446
# If the dotest directory exists, but we have finished applying all the
447
# patches in them, clear it out.
448
if test -d "$dotest" &&
449
+ test -f "$dotest/last" &&
450
+ test -f "$dotest/next" &&
451
last=$(cat "$dotest/last") &&
452
next=$(cat "$dotest/next") &&
453
test $# != 0 &&
@@ -454,7 +456,7 @@ then
456
rm -fr "$dotest"
457
fi
458
457
-if test -d "$dotest"
459
+if test -d "$dotest" && test -f "$dotest/last" && test -f "$dotest/next"
460
then
461
case "$#,$skip$resolved$abort" in
462
0,*t*)