Use 'git status' now it can handle initial commit.
Update 'git commit' to use the updated `git status`. Also earlier the `-s` flag was ignored for the initial commit. Signed-off-by: Junio C Hamano <junkio@cox.net>maint
parent
7e011c40bc
commit
2d56993347
|
@ -113,21 +113,6 @@ t)
|
||||||
fi
|
fi
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ ! -r "$GIT_DIR/HEAD" ]
|
|
||||||
then
|
|
||||||
echo "#"
|
|
||||||
echo "# Initial commit"
|
|
||||||
echo "#"
|
|
||||||
git-ls-files | sed 's/^/# New file: /'
|
|
||||||
echo "#"
|
|
||||||
elif [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
|
||||||
echo "#"
|
|
||||||
echo "# It looks like your may be committing a MERGE."
|
|
||||||
echo "# If this is not correct, please remove the file"
|
|
||||||
echo "# $GIT_DIR/MERGE_HEAD"
|
|
||||||
echo "# and try again"
|
|
||||||
echo "#"
|
|
||||||
fi >.editmsg
|
|
||||||
if test "$log_message" != ''
|
if test "$log_message" != ''
|
||||||
then
|
then
|
||||||
echo "$log_message"
|
echo "$log_message"
|
||||||
|
@ -144,7 +129,25 @@ then
|
||||||
elif test "$use_commit" != ""
|
elif test "$use_commit" != ""
|
||||||
then
|
then
|
||||||
git-cat-file commit "$use_commit" | sed -e '1,/^$/d'
|
git-cat-file commit "$use_commit" | sed -e '1,/^$/d'
|
||||||
fi | git-stripspace >>.editmsg
|
fi | git-stripspace >.editmsg
|
||||||
|
|
||||||
|
case "$signoff" in
|
||||||
|
t)
|
||||||
|
git-var GIT_COMMITTER_IDENT | sed -e '
|
||||||
|
s/>.*/>/
|
||||||
|
s/^/Signed-off-by: /
|
||||||
|
' >>.editmsg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -f "$GIT_DIR/MERGE_HEAD" ]; then
|
||||||
|
echo "#"
|
||||||
|
echo "# It looks like your may be committing a MERGE."
|
||||||
|
echo "# If this is not correct, please remove the file"
|
||||||
|
echo "# $GIT_DIR/MERGE_HEAD"
|
||||||
|
echo "# and try again"
|
||||||
|
echo "#"
|
||||||
|
fi >>.editmsg
|
||||||
|
|
||||||
PARENTS="-p HEAD"
|
PARENTS="-p HEAD"
|
||||||
if [ ! -r "$GIT_DIR/HEAD" ]; then
|
if [ ! -r "$GIT_DIR/HEAD" ]; then
|
||||||
|
@ -186,16 +189,8 @@ else
|
||||||
export GIT_AUTHOR_EMAIL
|
export GIT_AUTHOR_EMAIL
|
||||||
export GIT_AUTHOR_DATE
|
export GIT_AUTHOR_DATE
|
||||||
fi
|
fi
|
||||||
case "$signoff" in
|
|
||||||
t)
|
|
||||||
git-var GIT_COMMITTER_IDENT | sed -e '
|
|
||||||
s/>.*/>/
|
|
||||||
s/^/Signed-off-by: /
|
|
||||||
' >>.editmsg
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
git-status-script >>.editmsg
|
|
||||||
fi
|
fi
|
||||||
|
git-status-script >>.editmsg
|
||||||
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
|
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
|
||||||
then
|
then
|
||||||
rm -f .editmsg
|
rm -f .editmsg
|
||||||
|
|
Loading…
Reference in New Issue