diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-10-19 16:06:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-10-19 16:06:21 -0700 |
commit | 4f2d651e5b3414eac5d22ff47366d22c8cc289f6 (patch) | |
tree | 1d6a6531fe0170679bfd193c4516e91c00cbb438 /builtin-merge.c | |
parent | ce6e5ff435f325769dd28980cf3c8b1625f194f2 (diff) | |
parent | cf10f9fdd5e673a163847f0e931ce9731507e03b (diff) | |
download | git-4f2d651e5b3414eac5d22ff47366d22c8cc289f6.tar.gz git-4f2d651e5b3414eac5d22ff47366d22c8cc289f6.tar.xz |
Merge branch 'mv/merge-noff'
* mv/merge-noff:
builtin-commit: use reduce_heads() only when appropriate
Conflicts:
builtin-commit.c
t/t7600-merge.sh
Diffstat (limited to 'builtin-merge.c')
-rw-r--r-- | builtin-merge.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin-merge.c b/builtin-merge.c index 5e2b7f12c..5e7910bd8 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -179,6 +179,7 @@ static void drop_save(void) { unlink(git_path("MERGE_HEAD")); unlink(git_path("MERGE_MSG")); + unlink(git_path("MERGE_MODE")); } static void save_state(void) @@ -1210,6 +1211,15 @@ int cmd_merge(int argc, const char **argv, const char *prefix) merge_msg.len) die("Could not write to %s", git_path("MERGE_MSG")); close(fd); + fd = open(git_path("MERGE_MODE"), O_WRONLY | O_CREAT | O_TRUNC, 0666); + if (fd < 0) + die("Could open %s for writing", git_path("MERGE_MODE")); + strbuf_reset(&buf); + if (!allow_fast_forward) + strbuf_addf(&buf, "no-ff"); + if (write_in_full(fd, buf.buf, buf.len) != buf.len) + die("Could not write to %s", git_path("MERGE_MODE")); + close(fd); } if (merge_was_ok) { |