diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-12 13:24:04 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-12 13:24:04 -0700 |
commit | 3103c005207f0840782804b9387b3a831005bb9c (patch) | |
tree | 51d1c31f842c5f56e3dd42eeb9ca0980e716853c /git-commit.sh | |
parent | 8bc7574b6332ef45645c6e0917e9d59919b277ef (diff) | |
parent | f4ee3eb68906f079dea45de4f1bbb03d68189eb3 (diff) | |
download | git-3103c005207f0840782804b9387b3a831005bb9c.tar.gz |
Merge branch 'master' into jc/combine
* master:
stripspace: make sure not to leave an incomplete line.
git-commit: do not muck with commit message when no_edit is set.
When showing a commit message, do not lose an incomplete line.
Retire t5501-old-fetch-and-upload test.
Diffstat (limited to 'git-commit.sh')
-rwxr-xr-x | git-commit.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/git-commit.sh b/git-commit.sh index 1e7c09e1f2..bd3dc71cd6 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -537,7 +537,7 @@ t) ;; esac -if [ -f "$GIT_DIR/MERGE_HEAD" ]; then +if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then echo "#" echo "# It looks like you may be committing a MERGE." echo "# If this is not correct, please remove the file" @@ -605,16 +605,23 @@ else current= fi -{ - test -z "$only_include_assumed" || echo "$only_include_assumed" - run_status -} >>"$GIT_DIR"/COMMIT_EDITMSG +if test -z "$no_edit" +then + { + test -z "$only_include_assumed" || echo "$only_include_assumed" + run_status + } >>"$GIT_DIR"/COMMIT_EDITMSG +else + # we need to check if there is anything to commit + run_status >/dev/null +fi if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ] then rm -f "$GIT_DIR/COMMIT_EDITMSG" run_status exit 1 fi + case "$no_edit" in '') case "${VISUAL:-$EDITOR},$TERM" in |