struct name_entry: use struct object_id instead of unsigned char sha1[20]

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2016-04-17 23:10:39 +00:00
committed by Junio C Hamano
parent 82db3d44e7
commit 7d924c9139
17 changed files with 48 additions and 48 deletions

View File

@@ -2,7 +2,7 @@
#define TREE_WALK_H
struct name_entry {
const unsigned char *sha1;
const struct object_id *oid;
const char *path;
unsigned int mode;
};
@@ -17,12 +17,12 @@ static inline const unsigned char *tree_entry_extract(struct tree_desc *desc, co
{
*pathp = desc->entry.path;
*modep = desc->entry.mode;
return desc->entry.sha1;
return desc->entry.oid->hash;
}
static inline int tree_entry_len(const struct name_entry *ne)
{
return (const char *)ne->sha1 - ne->path - 1;
return (const char *)ne->oid - ne->path - 1;
}
void update_tree_entry(struct tree_desc *);