aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-22 20:41:17 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-22 21:24:47 -0800
commiteb7a2f1d50ca8620b087dd2751d0fe2505e7974f (patch)
tree76405bdea23e14792a88b8e38229ca080af3d5d4 /unpack-trees.c
parentd070e3a31bf94de1ef503b155a5e028545f7decc (diff)
downloadgit-eb7a2f1d50ca8620b087dd2751d0fe2505e7974f.tar.gz
git-eb7a2f1d50ca8620b087dd2751d0fe2505e7974f.tar.xz
Use helper function for copying index entry information
We used to just memcpy() the index entry when we copied the stat() and SHA1 hash information, which worked well enough back when the index entry was just an exact bit-for-bit representation of the information on disk. However, these days we actually have various management information in the cache entry too, and we should be careful to not overwrite it when we copy the stat information from another index entry. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index ec558f900..07c4c28a5 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -590,7 +590,7 @@ static int merged_entry(struct cache_entry *merge, struct cache_entry *old,
* a match.
*/
if (same(old, merge)) {
- memcpy(merge, old, offsetof(struct cache_entry, name));
+ copy_cache_entry(merge, old);
} else {
verify_uptodate(old, o);
invalidate_ce_path(old);