Skip to content

Commit b967851

Browse files
committed
Merge branch 'kn/loose-object-layer-wo-global-hash'
Code clean-up. * kn/loose-object-layer-wo-global-hash: loose: don't rely on repository global state
2 parents ee064ba + 432f666 commit b967851

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

loose.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#define USE_THE_REPOSITORY_VARIABLE
2-
31
#include "git-compat-util.h"
42
#include "hash.h"
53
#include "path.h"
64
#include "object-store.h"
75
#include "hex.h"
6+
#include "repository.h"
87
#include "wrapper.h"
98
#include "gettext.h"
109
#include "loose.h"
@@ -142,8 +141,8 @@ int repo_write_loose_object_map(struct repository *repo)
142141

143142
for (; iter != kh_end(map); iter++) {
144143
if (kh_exist(map, iter)) {
145-
if (oideq(&kh_key(map, iter), the_hash_algo->empty_tree) ||
146-
oideq(&kh_key(map, iter), the_hash_algo->empty_blob))
144+
if (oideq(&kh_key(map, iter), repo->hash_algo->empty_tree) ||
145+
oideq(&kh_key(map, iter), repo->hash_algo->empty_blob))
147146
continue;
148147
strbuf_addf(&buf, "%s %s\n", oid_to_hex(&kh_key(map, iter)), oid_to_hex(kh_value(map, iter)));
149148
if (write_in_full(fd, buf.buf, buf.len) < 0)

0 commit comments

Comments
 (0)