4 #include "match-trees.h"
5 #include "object-name.h"
6 #include "repository.h"
10 int cmd__match_trees(int ac
, const char **av
)
12 struct object_id hash1
, hash2
, shifted
;
13 struct tree
*one
, *two
;
15 setup_git_directory();
17 if (repo_get_oid(the_repository
, av
[1], &hash1
))
18 die("cannot parse %s as an object name", av
[1]);
19 if (repo_get_oid(the_repository
, av
[2], &hash2
))
20 die("cannot parse %s as an object name", av
[2]);
21 one
= parse_tree_indirect(&hash1
);
23 die("not a tree-ish %s", av
[1]);
24 two
= parse_tree_indirect(&hash2
);
26 die("not a tree-ish %s", av
[2]);
28 shift_tree(the_repository
, &one
->object
.oid
, &two
->object
.oid
, &shifted
, -1);
29 printf("shifted: %s\n", oid_to_hex(&shifted
));