summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-09-05 20:07:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-07 19:59:42 (GMT)
commit99d1a9861ae88595e7386c453b6b38573a8a570c (patch)
tree670664666d85bb83d7d80b83904c25adb5b7029a /builtin/checkout.c
parent6ebdac1bab966b720d776aa43ca188fe378b1f4b (diff)
downloadgit-99d1a9861ae88595e7386c453b6b38573a8a570c.zip
git-99d1a9861ae88595e7386c453b6b38573a8a570c.tar.gz
git-99d1a9861ae88595e7386c453b6b38573a8a570c.tar.bz2
cache: convert struct cache_entry to use struct object_id
Convert struct cache_entry to use struct object_id by applying the following semantic patch and the object_id transforms from contrib, plus the actual change to the struct: @@ struct cache_entry E1; @@ - E1.sha1 + E1.oid.hash @@ struct cache_entry *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 8672d07..a9523ff 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -76,7 +76,7 @@ static int update_some(const unsigned char *sha1, struct strbuf *base,
len = base->len + strlen(pathname);
ce = xcalloc(1, cache_entry_size(len));
- hashcpy(ce->sha1, sha1);
+ hashcpy(ce->oid.hash, sha1);
memcpy(ce->name, base->buf, base->len);
memcpy(ce->name + base->len, pathname, len - base->len);
ce->ce_flags = create_ce_flags(0) | CE_UPDATE;
@@ -92,7 +92,7 @@ static int update_some(const unsigned char *sha1, struct strbuf *base,
if (pos >= 0) {
struct cache_entry *old = active_cache[pos];
if (ce->ce_mode == old->ce_mode &&
- !hashcmp(ce->sha1, old->sha1)) {
+ !oidcmp(&ce->oid, &old->oid)) {
old->ce_flags |= CE_UPDATE;
free(ce);
return 0;
@@ -186,7 +186,7 @@ static int checkout_merged(int pos, struct checkout *state)
stage = ce_stage(ce);
if (!stage || strcmp(path, ce->name))
break;
- hashcpy(threeway[stage - 1], ce->sha1);
+ hashcpy(threeway[stage - 1], ce->oid.hash);
if (stage == 2)
mode = create_ce_mode(ce->ce_mode);
pos++;