git am: Remove stray error message from sed
authorRamkumar Ramachandra <artagnon@gmail.com>
Wed, 2 Jun 2010 08:33:37 +0000 (10:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Jun 2010 16:53:45 +0000 (09:53 -0700)
When --continue is invoked without any changes, the following stray
error message appears- sed: can't read $dotest/final-commit: No such
file or directory. Remove this by making sure that the file actually
exists.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh

index b6068df6bf790851bc271d642706f38fe079ebac..d3f6a893527bcf4c14195763c1fc3e35d023e645 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -693,7 +693,13 @@ do
        else
            action=yes
        fi
-       FIRSTLINE=$(sed 1q "$dotest/final-commit")
+
+       if test -f "$dotest/final-commit"
+       then
+               FIRSTLINE=$(sed 1q "$dotest/final-commit")
+       else
+               FIRSTLINE=""
+       fi
 
        if test $action = skip
        then