summaryrefslogtreecommitdiff
path: root/builtin-merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-10-19 16:06:21 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-19 16:06:21 -0700
commit4f2d651e5b3414eac5d22ff47366d22c8cc289f6 (patch)
tree1d6a6531fe0170679bfd193c4516e91c00cbb438 /builtin-merge.c
parentce6e5ff435f325769dd28980cf3c8b1625f194f2 (diff)
parentcf10f9fdd5e673a163847f0e931ce9731507e03b (diff)
downloadgit-4f2d651e5b3414eac5d22ff47366d22c8cc289f6.tar.gz
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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin-merge.c b/builtin-merge.c
index 5e2b7f12c3..5e7910bd8d 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) {