Skip to content

Commit

Permalink
am: tighten a conditional that checks for $dotest
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed May 13, 2013
1 parent 7d3ccdf commit c30754f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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*)
Expand Down

0 comments on commit c30754f

Please sign in to comment.