summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:38 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:39 -0700
commit21bed620cd2d4fc4fb3d42447136c9f899ede5bb (patch)
tree55fe7e104798ec1689d4e3513e81563a0188317f /merge-recursive.c
parentfc08d2d4add543b88d7e1573cb4be01adedfed00 (diff)
parent1335d76e4569fa84e52dc24c88c04daeae6e160e (diff)
downloadgit-21bed620cd2d4fc4fb3d42447136c9f899ede5bb.tar.gz
Merge branch 'jc/renormalize-merge-kill-safer-crlf'
"git merge" with renormalization did not work well with merge-recursive, due to "safer crlf" conversion kicking in when it shouldn't. * jc/renormalize-merge-kill-safer-crlf: merge: avoid "safer crlf" during recording of merge results convert: unify the "auto" handling of CRLF
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 48fe7e7386..a4a1195f61 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -202,12 +202,21 @@ static int add_cacheinfo(unsigned int mode, const struct object_id *oid,
const char *path, int stage, int refresh, int options)
{
struct cache_entry *ce;
- ce = make_cache_entry(mode, oid ? oid->hash : null_sha1, path, stage,
- (refresh ? (CE_MATCH_REFRESH |
- CE_MATCH_IGNORE_MISSING) : 0 ));
+ int ret;
+
+ ce = make_cache_entry(mode, oid ? oid->hash : null_sha1, path, stage, 0);
if (!ce)
return error(_("addinfo_cache failed for path '%s'"), path);
- return add_cache_entry(ce, options);
+
+ ret = add_cache_entry(ce, options);
+ if (refresh) {
+ struct cache_entry *nce;
+
+ nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING);
+ if (nce != ce)
+ ret = add_cache_entry(nce, options);
+ }
+ return ret;
}
static void init_tree_desc_from_tree(struct tree_desc *desc, struct tree *tree)