Skip to content

Commit c30754f

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7d3ccdf commit c30754f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-am.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ done
446446
# If the dotest directory exists, but we have finished applying all the
447447
# patches in them, clear it out.
448448
if test -d "$dotest" &&
449+
test -f "$dotest/last" &&
450+
test -f "$dotest/next" &&
449451
last=$(cat "$dotest/last") &&
450452
next=$(cat "$dotest/next") &&
451453
test $# != 0 &&
@@ -454,7 +456,7 @@ then
454456
rm -fr "$dotest"
455457
fi
456458

457-
if test -d "$dotest"
459+
if test -d "$dotest" && test -f "$dotest/last" && test -f "$dotest/next"
458460
then
459461
case "$#,$skip$resolved$abort" in
460462
0,*t*)

0 commit comments

Comments
 (0)