]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-match-trees.c
6 int cmd__match_trees(int ac
, const char **av
)
8 struct object_id hash1
, hash2
, shifted
;
9 struct tree
*one
, *two
;
11 setup_git_directory();
13 if (get_oid(av
[1], &hash1
))
14 die("cannot parse %s as an object name", av
[1]);
15 if (get_oid(av
[2], &hash2
))
16 die("cannot parse %s as an object name", av
[2]);
17 one
= parse_tree_indirect(&hash1
);
19 die("not a tree-ish %s", av
[1]);
20 two
= parse_tree_indirect(&hash2
);
22 die("not a tree-ish %s", av
[2]);
24 shift_tree(the_repository
, &one
->object
.oid
, &two
->object
.oid
, &shifted
, -1);
25 printf("shifted: %s\n", oid_to_hex(&shifted
));