diff options
author | Edward Thomson <ethomson@github.com> | 2016-08-05 19:30:56 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2016-08-05 19:30:56 -0400 |
commit | becadafca8b3ac69884c43a8826f929668cc7663 (patch) | |
tree | b3f48f98daa4e2d622803f84bd71152e62c1d996 /src/odb.c | |
parent | 56bbdf9349c31d6d326e4d754760549aa85bb425 (diff) | |
download | libgit2-becadafca8b3ac69884c43a8826f929668cc7663.tar.gz |
odb: only provide the empty tree
Only provide the empty tree internally, which matches git's behavior.
If we provide the empty blob then any users trying to write it with
libgit2 would omit it from actually landing in the odb, which appear
to git proper as a broken repository (missing that object).
Diffstat (limited to 'src/odb.c')
-rw-r--r-- | src/odb.c | 5 |
1 files changed, 0 insertions, 5 deletions
@@ -54,14 +54,9 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_ static git_otype odb_hardcoded_type(const git_oid *id) { - static git_oid empty_blob = {{ 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1, 0xd6, 0x43, 0x4b, 0x8b, - 0x29, 0xae, 0x77, 0x5a, 0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91 }}; static git_oid empty_tree = {{ 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60, 0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }}; - if (!git_oid_cmp(id, &empty_blob)) - return GIT_OBJ_BLOB; - if (!git_oid_cmp(id, &empty_tree)) return GIT_OBJ_TREE; |