Skip to content

Commit c9baaf9

Browse files
bk2204gitster
authored andcommitted
test-match-trees: convert to use struct object_id
Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2764fd9 commit c9baaf9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test-match-trees.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
int main(int ac, char **av)
55
{
6-
unsigned char hash1[20], hash2[20], shifted[20];
6+
struct object_id hash1, hash2, shifted;
77
struct tree *one, *two;
88

9-
if (get_sha1(av[1], hash1))
9+
if (get_oid(av[1], &hash1))
1010
die("cannot parse %s as an object name", av[1]);
11-
if (get_sha1(av[2], hash2))
11+
if (get_oid(av[2], &hash2))
1212
die("cannot parse %s as an object name", av[2]);
13-
one = parse_tree_indirect(hash1);
13+
one = parse_tree_indirect(hash1.hash);
1414
if (!one)
1515
die("not a tree-ish %s", av[1]);
16-
two = parse_tree_indirect(hash2);
16+
two = parse_tree_indirect(hash2.hash);
1717
if (!two)
1818
die("not a tree-ish %s", av[2]);
1919

20-
shift_tree(one->object.oid.hash, two->object.oid.hash, shifted, -1);
21-
printf("shifted: %s\n", sha1_to_hex(shifted));
20+
shift_tree(one->object.oid.hash, two->object.oid.hash, shifted.hash, -1);
21+
printf("shifted: %s\n", oid_to_hex(&shifted));
2222

2323
exit(0);
2424
}

0 commit comments

Comments
 (0)