Skip to content

Commit 4939e2c

Browse files
bk2204gitster
authored andcommitted
builtin/read-tree: convert to struct object_id
This is a caller of parse_tree_indirect, which must be converted in order to convert parse_object. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent de37d50 commit 4939e2c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/read-tree.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ static int read_empty;
2323
static struct tree *trees[MAX_UNPACK_TREES];
2424
static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
2525

26-
static int list_tree(unsigned char *sha1)
26+
static int list_tree(struct object_id *oid)
2727
{
2828
struct tree *tree;
2929

3030
if (nr_trees >= MAX_UNPACK_TREES)
3131
die("I cannot read more than %d trees", MAX_UNPACK_TREES);
32-
tree = parse_tree_indirect(sha1);
32+
tree = parse_tree_indirect(oid->hash);
3333
if (!tree)
3434
return -1;
3535
trees[nr_trees++] = tree;
@@ -121,7 +121,7 @@ static struct lock_file lock_file;
121121
int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
122122
{
123123
int i, stage = 0;
124-
unsigned char sha1[20];
124+
struct object_id oid;
125125
struct tree_desc t[MAX_UNPACK_TREES];
126126
struct unpack_trees_options opts;
127127
int prefix_set = 0;
@@ -204,9 +204,9 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
204204
for (i = 0; i < argc; i++) {
205205
const char *arg = argv[i];
206206

207-
if (get_sha1(arg, sha1))
207+
if (get_oid(arg, &oid))
208208
die("Not a valid object name %s", arg);
209-
if (list_tree(sha1) < 0)
209+
if (list_tree(&oid) < 0)
210210
die("failed to unpack tree object %s", arg);
211211
stage++;
212212
}

0 commit comments

Comments
 (0)