Add "stripspace" program to clean up email commentary
[git.git] / applypatch
index 397e4a0..97274a1 100755 (executable)
@@ -32,7 +32,7 @@ if [ -n "$signoff" -a -f "$signoff" ]; then
        cat $signoff >> $MSGFILE
 fi
 
-(echo "[PATCH] $SUBJECT" ; echo ; cat $MSGFILE ) > $final
+(echo "[PATCH] $SUBJECT" ; if [ -s $MSGFILE ]; then echo ; cat $MSGFILE; fi ) > $final
 
 f=0
 [ -f $query_apply ] || f=1
@@ -57,13 +57,12 @@ echo
 echo Applying "'$SUBJECT'"
 echo
 
-check-files $(cat $FILES) || exit 1
-checkout-cache -q $(cat $FILES) || exit 1
+git-check-files $(cat $FILES) || exit 1
+git-checkout-cache -q $(cat $FILES) || exit 1
 patch -u --no-backup-if-mismatch -f -p1 --fuzz=0 --input=$PATCHFILE || exit 1
-update-cache --add --remove $(cat $FILES) || exit 1
-tree=$(write-tree) || exit 1
+git-update-cache --add --remove $(cat $FILES) || exit 1
+tree=$(git-write-tree) || exit 1
 echo Wrote tree $tree
-commit=$(commit-tree $tree -p $(cat .git/HEAD) < $final) || exit 1
+commit=$(git-commit-tree $tree -p $(cat .git/HEAD) < $final) || exit 1
 echo Committed: $commit
 echo $commit > .git/HEAD
-