summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2013-06-02 15:46:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-02 22:31:13 (GMT)
commitf2fa35420511cc49e85413a2932a1a2bac88cc1b (patch)
treeb168a221fccdbb082dd9eb02958b085a99293129 /diff-lib.c
parenta33bd4d34def15d12372aeb8c59a7465416f9f66 (diff)
downloadgit-f2fa35420511cc49e85413a2932a1a2bac88cc1b.zip
git-f2fa35420511cc49e85413a2932a1a2bac88cc1b.tar.gz
git-f2fa35420511cc49e85413a2932a1a2bac88cc1b.tar.bz2
unpack-trees: create working copy of merge entry in merged_entry
Duplicate the merge entry right away and work with that instead of modifying the entry we got and duplicating it only at the end of the function. Then mark that pointer const to document that we don't modify the referenced cache_entry. This change is safe because all existing merge functions call merged_entry just before returning (or not at all), i.e. they don't care about changes to the referenced cache_entry after the call. unpack_nondirectories and unpack_index_entry, which call the merge functions through call_unpack_fn, aren't interested in such changes neither. The change complicates merged_entry a bit because we have to free the copy if we error out, but allows callers to pass a const pointer. Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
0 files changed, 0 insertions, 0 deletions