summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-06-15 13:33:42 +0200
committerJunio C Hamano <gitster@pobox.com>2017-06-15 14:45:53 -0700
commitf47d1ebb15dfa56a3e2b1e2f79aafeed2f19b040 (patch)
treebcebb765b20ca6d50ce9f978d3d7bb18e1a32f70
parentfd99e2bda0ca6a361ef03c04d6d7fdc7a9c40b78 (diff)
downloadgit-rs/checkout-merged-pretend.tar.gz
checkout: don't write merge results into the object databasers/checkout-merged-pretend
Merge results need to be written to the worktree, of course, but we don't necessarily need object entries for them, especially if they contain conflict markers. Use pretend_sha1_file() to create fake blobs to pass to make_cache_entry() and checkout_entry() instead. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/checkout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index b360943455..a4c72a7a72 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -234,7 +234,7 @@ static int checkout_merged(int pos, const struct checkout *state)
/*
* NEEDSWORK:
- * There is absolutely no reason to write this as a blob object
+ * There is absolutely no reason to build a fake blob object
* and create a phony cache entry. This hack is primarily to get
* to the write_entry() machinery that massages the contents to
* work-tree format and writes out which only allows it for a
@@ -244,8 +244,8 @@ static int checkout_merged(int pos, const struct checkout *state)
* (it also writes the merge result to the object database even
* when it may contain conflicts).
*/
- if (write_sha1_file(result_buf.ptr, result_buf.size,
- blob_type, oid.hash))
+ if (pretend_sha1_file(result_buf.ptr, result_buf.size,
+ OBJ_BLOB, oid.hash))
die(_("Unable to add merge result for '%s'"), path);
free(result_buf.ptr);
ce = make_cache_entry(mode, oid.hash, path, 2, 0);