Make "git commit" clean up after itself
Noted by Jeff.
This commit is contained in:
@ -33,12 +33,16 @@ fi
|
|||||||
if [ "$?" != "0" ]
|
if [ "$?" != "0" ]
|
||||||
then
|
then
|
||||||
cat .editmsg
|
cat .editmsg
|
||||||
|
rm .editmsg
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
${VISUAL:-${EDITOR:-vi}} .editmsg
|
${VISUAL:-${EDITOR:-vi}} .editmsg
|
||||||
grep -v '^#' < .editmsg | git-stripspace > .cmitmsg
|
grep -v '^#' < .editmsg | git-stripspace > .cmitmsg
|
||||||
[ -s .cmitmsg ] || exit 1
|
[ -s .cmitmsg ] &&
|
||||||
tree=$(git-write-tree) || exit 1
|
tree=$(git-write-tree) &&
|
||||||
commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) || exit 1
|
commit=$(cat .cmitmsg | git-commit-tree $tree $PARENTS) &&
|
||||||
echo $commit > $GIT_DIR/HEAD
|
echo $commit > $GIT_DIR/HEAD &&
|
||||||
rm -f -- $GIT_DIR/MERGE_HEAD
|
rm -f -- $GIT_DIR/MERGE_HEAD
|
||||||
|
ret="$?"
|
||||||
|
rm -f .cmitmsg .editmsg
|
||||||
|
exit "$ret"
|
||||||
|
Reference in New Issue
Block a user