diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-08-17 11:11:03 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-19 01:02:05 +0400 |
commit | 2a70fa4f1e377bc68bcabdc1a550e9970acccda7 (patch) | |
tree | d1b19f888eaeba736f1fe2ad704a1294772a192f /contrib/examples/git-merge.sh | |
parent | f07df52489c78c33c5c5c1bd973038283c401582 (diff) |
merge script: handle --no-ff --no-commit correctly
In a --no-ff merge with conflicts, "git commit" used to forget the
--no-ff when used to complete the merge. That was fixed by
v1.6.1-rc1~134^2 (builtin-commit: use reduce_heads() only when
appropriate, 2008-10-03) for the builtin merge. Port the change to
the merge script in contrib/examples.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/examples/git-merge.sh')
-rwxr-xr-x | contrib/examples/git-merge.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index dfd6e17946..5a2addd4e1 100755 --- a/contrib/examples/git-merge.sh +++ b/contrib/examples/git-merge.sh @@ -52,7 +52,7 @@ squash= no_commit= log_arg= dropsave() { rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \ - "$GIT_DIR/MERGE_STASH" || exit 1 + "$GIT_DIR/MERGE_STASH" "$GIT_DIR/MERGE_MODE" || exit 1 } savestate() { @@ -585,7 +585,15 @@ else do echo $remote done >"$GIT_DIR/MERGE_HEAD" - printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG" + printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG" || + die "Could not write to $GIT_DIR/MERGE_MSG" + if test "$allow_fast_forward" != t + then + printf "%s" no-ff + else + : + fi >"$GIT_DIR/MERGE_MODE" || + die "Could not write to $GIT_DIR/MERGE_MODE" fi if test "$merge_was_ok" = t |