path: root/dir.c
diff options
authorJunio C Hamano <>2016-09-19 20:47:19 (GMT)
committerJunio C Hamano <>2016-09-19 20:47:19 (GMT)
commit4af9a7d344b0e1c3b504c0cfb650dabdb1df1852 (patch)
tree243319fc09235a1e046ea94f40f7837ed9f02ea2 /dir.c
parent4322f3848a224843a2df81055f07899ce1a1b388 (diff)
parent3a5d7c55f76681ad9dcef8564275217881c9ace0 (diff)
Merge branch 'bc/object-id'
The "unsigned char sha1[20]" to "struct object_id" conversion continues. Notable changes in this round includes that ce->sha1, i.e. the object name recorded in the cache_entry, turns into an object_id. It had merge conflicts with a few topics in flight (Christian's "apply.c split", Dscho's "cat-file --filters" and Jeff Hostetler's "status --porcelain-v2"). Extra sets of eyes double-checking for mismerges are highly appreciated. * bc/object-id: builtin/reset: convert to use struct object_id builtin/commit-tree: convert to struct object_id builtin/am: convert to struct object_id refs: add an update_ref_oid function. sha1_name: convert get_sha1_mb to struct object_id builtin/update-index: convert file to struct object_id notes: convert init_notes to use struct object_id builtin/rm: convert to use struct object_id builtin/blame: convert file to use struct object_id Convert read_mmblob to take struct object_id. notes-merge: convert struct notes_merge_pair to struct object_id builtin/checkout: convert some static functions to struct object_id streaming: make stream_blob_to_fd take struct object_id builtin: convert textconv_object to use struct object_id builtin/cat-file: convert some static functions to struct object_id builtin/cat-file: convert struct expand_data to use struct object_id builtin/log: convert some static functions to use struct object_id builtin/blame: convert struct origin to use struct object_id builtin/apply: convert static functions to struct object_id cache: convert struct cache_entry to use struct object_id
Diffstat (limited to 'dir.c')
1 files changed, 4 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 0ea235f..9e09bcb 100644
--- a/dir.c
+++ b/dir.c
@@ -525,7 +525,7 @@ static void *read_skip_worktree_file_from_index(const char *path, size_t *size,
return NULL;
if (!ce_skip_worktree(active_cache[pos]))
return NULL;
- data = read_sha1_file(active_cache[pos]->sha1, &type, &sz);
+ data = read_sha1_file(active_cache[pos]->oid.hash, &type, &sz);
if (!data || type != OBJ_BLOB) {
return NULL;
@@ -533,7 +533,7 @@ static void *read_skip_worktree_file_from_index(const char *path, size_t *size,
*size = xsize_t(sz);
if (sha1_stat) {
memset(&sha1_stat->stat, 0, sizeof(sha1_stat->stat));
- hashcpy(sha1_stat->sha1, active_cache[pos]->sha1);
+ hashcpy(sha1_stat->sha1, active_cache[pos]->oid.hash);
return data;
@@ -713,7 +713,8 @@ static int add_excludes(const char *fname, const char *base, int baselen,
!ce_stage(active_cache[pos]) &&
ce_uptodate(active_cache[pos]) &&
- hashcpy(sha1_stat->sha1, active_cache[pos]->sha1);
+ hashcpy(sha1_stat->sha1,
+ active_cache[pos]->oid.hash);
hash_sha1_file(buf, size, "blob", sha1_stat->sha1);
fill_stat_data(&sha1_stat->stat, &st);