Fix cvs2git branch handling
[gitweb.git] / applypatch
index 6e21409682bd858a3f63bdbaeacce29138be56a6..9c191ae746621b5a2a0387516f0ba7c4525df87b 100755 (executable)
@@ -24,15 +24,16 @@ INFO=$4
 EDIT=${VISUAL:-$EDITOR}
 EDIT=${EDIT:-vi}
 
-export AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' .dotest/info)"
-export AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' .dotest/info)"
+export GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' .dotest/info)"
+export GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' .dotest/info)"
+export GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' .dotest/info)"
 export SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' .dotest/info)"
 
 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
@@ -59,7 +60,7 @@ echo
 
 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
+patch -E -u --no-backup-if-mismatch -f -p1 --fuzz=0 --input=$PATCHFILE || exit 1
 git-update-cache --add --remove $(cat $FILES) || exit 1
 tree=$(git-write-tree) || exit 1
 echo Wrote tree $tree