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