setup.h: move declarations for setup.c functions from cache.h
[git.git] / t / helper / test-match-trees.c
blob64705734dfec9e823416f2bb449b94d14d45495f
1 #include "test-tool.h"
2 #include "cache.h"
3 #include "hex.h"
4 #include "setup.h"
5 #include "tree.h"
7 int cmd__match_trees(int ac, const char **av)
9 struct object_id hash1, hash2, shifted;
10 struct tree *one, *two;
12 setup_git_directory();
14 if (get_oid(av[1], &hash1))
15 die("cannot parse %s as an object name", av[1]);
16 if (get_oid(av[2], &hash2))
17 die("cannot parse %s as an object name", av[2]);
18 one = parse_tree_indirect(&hash1);
19 if (!one)
20 die("not a tree-ish %s", av[1]);
21 two = parse_tree_indirect(&hash2);
22 if (!two)
23 die("not a tree-ish %s", av[2]);
25 shift_tree(the_repository, &one->object.oid, &two->object.oid, &shifted, -1);
26 printf("shifted: %s\n", oid_to_hex(&shifted));
28 return 0;