Skip to content

Commit e124ecf

Browse files
rscharfegitster
authored andcommitted
archive: convert queue_directory to struct object_id
Pass the struct object_id on instead of just its hash member. This is simpler and avoids the need to guess the algorithm. Signed-off-by: René Scharfe <[email protected]> Acked-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 225bc32 commit e124ecf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

archive.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
191191
return err;
192192
}
193193

194-
static void queue_directory(const unsigned char *sha1,
194+
static void queue_directory(const struct object_id *oid,
195195
struct strbuf *base, const char *filename,
196196
unsigned mode, struct archiver_context *c)
197197
{
@@ -203,7 +203,7 @@ static void queue_directory(const unsigned char *sha1,
203203
d->mode = mode;
204204
c->bottom = d;
205205
d->len = xsnprintf(d->path, len, "%.*s%s/", (int)base->len, base->buf, filename);
206-
oidread(&d->oid, sha1);
206+
oidcpy(&d->oid, oid);
207207
}
208208

209209
static int write_directory(struct archiver_context *c)
@@ -250,8 +250,7 @@ static int queue_or_write_archive_entry(const struct object_id *oid,
250250

251251
if (check_attr_export_ignore(check))
252252
return 0;
253-
queue_directory(oid->hash, base, filename,
254-
mode, c);
253+
queue_directory(oid, base, filename, mode, c);
255254
return READ_TREE_RECURSIVE;
256255
}
257256

0 commit comments

Comments
 (0)