3 ## applypatch takes four file arguments, and uses those to
4 ## apply the unpacked patch (surprise surprise) that they
5 ## represent to the current tree.
8 ## $1 - file with commit message
9 ## $2 - file with the actual patch
10 ## $3 - file with list of filenames the patch touches
11 ## $4 - "info" file with Author, email and subject
17 export AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' .dotest/info)"
18 export AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' .dotest/info)"
19 export SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' .dotest/info)"
22 echo Applying $SUBJECT
25 (echo "[PATCH] $SUBJECT" ; echo ; cat $MSGFILE ) > .dotest/final-commit
27 check-files $(cat $FILES) || exit 1
28 patch -u --no-backup-if-mismatch -f -p1 --fuzz=0 --input=$PATCHFILE || exit 1
29 update-cache --add --remove $(cat $FILES) || exit 1
30 tree=$(write-tree) || exit 1
32 commit=$(commit-tree $tree -p $(cat .git/HEAD) < .dotest/final-commit) || exit 1
33 echo Committed: $commit
34 echo $commit > .git/HEAD