]> git.ipfire.org Git - thirdparty/git.git/commitdiff
am: tighten a conditional that checks for $dotest
authorRamkumar Ramachandra <artagnon@gmail.com>
Sun, 12 May 2013 11:56:35 +0000 (17:26 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 May 2013 06:20:07 +0000 (23:20 -0700)
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>
git-am.sh

index c092855dd7c277d41288ee89f033bef0a8677a9f..ccb854a20e51d2522c8744742c10b3f5d70d7a9e 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -446,6 +446,8 @@ done
 # If the dotest directory exists, but we have finished applying all the
 # patches in them, clear it out.
 if test -d "$dotest" &&
+   test -f "$dotest/last" &&
+   test -f "$dotest/next" &&
    last=$(cat "$dotest/last") &&
    next=$(cat "$dotest/next") &&
    test $# != 0 &&
@@ -454,7 +456,7 @@ then
    rm -fr "$dotest"
 fi
 
-if test -d "$dotest"
+if test -d "$dotest" && test -f "$dotest/last" && test -f "$dotest/next"
 then
        case "$#,$skip$resolved$abort" in
        0,*t*)