1 #define USE_THE_REPOSITORY_VARIABLE
5 #include "match-trees.h"
6 #include "object-name.h"
7 #include "repository.h"
11 int cmd__match_trees(int ac UNUSED
, const char **av
)
13 struct object_id hash1
, hash2
, shifted
;
14 struct tree
*one
, *two
;
16 setup_git_directory();
18 if (repo_get_oid(the_repository
, av
[1], &hash1
))
19 die("cannot parse %s as an object name", av
[1]);
20 if (repo_get_oid(the_repository
, av
[2], &hash2
))
21 die("cannot parse %s as an object name", av
[2]);
22 one
= parse_tree_indirect(&hash1
);
24 die("not a tree-ish %s", av
[1]);
25 two
= parse_tree_indirect(&hash2
);
27 die("not a tree-ish %s", av
[2]);
29 shift_tree(the_repository
, &one
->object
.oid
, &two
->object
.oid
, &shifted
, -1);
30 printf("shifted: %s\n", oid_to_hex(&shifted
));