Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJameson Miller <jamill@microsoft.com>2018-07-02 22:49:30 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-03 20:58:15 +0300
commit825ed4d9a044380ac093563e6bd74311ea4488ef (patch)
treefcfb270dee1a6d626b4f2d37cbc45ee3534b4b64 /read-cache.c
parent768d7965068189ec5287ac53b4b55bfd443bb456 (diff)
read-cache: teach make_cache_entry to take object_id
Teach make_cache_entry function to take object_id instead of a SHA-1. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/read-cache.c b/read-cache.c
index fa8366ecab..c12664c789 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -746,8 +746,10 @@ int add_file_to_index(struct index_state *istate, const char *path, int flags)
}
struct cache_entry *make_cache_entry(unsigned int mode,
- const unsigned char *sha1, const char *path, int stage,
- unsigned int refresh_options)
+ const struct object_id *oid,
+ const char *path,
+ int stage,
+ unsigned int refresh_options)
{
int size, len;
struct cache_entry *ce, *ret;
@@ -761,7 +763,7 @@ struct cache_entry *make_cache_entry(unsigned int mode,
size = cache_entry_size(len);
ce = xcalloc(1, size);
- hashcpy(ce->oid.hash, sha1);
+ oidcpy(&ce->oid, oid);
memcpy(ce->name, path, len);
ce->ce_flags = create_ce_flags(stage);
ce->ce_namelen = len;