summaryrefslogtreecommitdiff
path: root/entry.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 /entry.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 'entry.c')
-rw-r--r--entry.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/entry.c b/entry.c
index 519e042..ce80d29 100644
--- a/entry.c
+++ b/entry.c
@@ -82,7 +82,7 @@ static int create_file(const char *path, unsigned int mode)
static void *read_blob_entry(const struct cache_entry *ce, unsigned long *size)
{
enum object_type type;
- void *new = read_sha1_file(ce->sha1, &type, size);
+ void *new = read_sha1_file(ce->oid.hash, &type, size);
if (new) {
if (type == OBJ_BLOB)
@@ -127,7 +127,7 @@ static int streaming_write_entry(const struct cache_entry *ce, char *path,
if (fd < 0)
return -1;
- result |= stream_blob_to_fd(fd, ce->sha1, filter, 1);
+ result |= stream_blob_to_fd(fd, ce->oid.hash, filter, 1);
*fstat_done = fstat_output(fd, state, statbuf);
result |= close(fd);
@@ -148,7 +148,8 @@ static int write_entry(struct cache_entry *ce,
struct stat st;
if (ce_mode_s_ifmt == S_IFREG) {
- struct stream_filter *filter = get_stream_filter(ce->name, ce->sha1);
+ struct stream_filter *filter = get_stream_filter(ce->name,
+ ce->oid.hash);
if (filter &&
!streaming_write_entry(ce, path, filter,
state, to_tempfile,
@@ -162,7 +163,7 @@ static int write_entry(struct cache_entry *ce,
new = read_blob_entry(ce, &size);
if (!new)
return error("unable to read sha1 file of %s (%s)",
- path, sha1_to_hex(ce->sha1));
+ path, oid_to_hex(&ce->oid));
if (ce_mode_s_ifmt == S_IFLNK && has_symlinks && !to_tempfile) {
ret = symlink(new, path);