diff options
| author | Junio C Hamano <junkio@cox.net> | 2006-04-12 13:24:48 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2006-04-12 13:24:48 -0700 |
| commit | 02376287ffd8b37ea7622fd4b61d654855112e75 (patch) | |
| tree | 012240009f9afed51301c938dae22c95ce3e72c7 /git-commit.sh | |
| parent | Merge branch 'jc/combine' into next (diff) | |
| parent | Merge branch 'master' into jc/combine (diff) | |
| download | git-02376287ffd8b37ea7622fd4b61d654855112e75.tar.gz git-02376287ffd8b37ea7622fd4b61d654855112e75.zip | |
Merge branch 'jc/combine' into next
* jc/combine:
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.
combine-diff: type fix.
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 |
