]>
Commit | Line | Data |
---|---|---|
9080e75f | 1 | #include "test-tool.h" |
68faf689 | 2 | #include "cache.h" |
41771fa4 | 3 | #include "hex.h" |
e38da487 | 4 | #include "setup.h" |
68faf689 JH |
5 | #include "tree.h" |
6 | ||
9080e75f | 7 | int cmd__match_trees(int ac, const char **av) |
68faf689 | 8 | { |
c9baaf9d | 9 | struct object_id hash1, hash2, shifted; |
68faf689 JH |
10 | struct tree *one, *two; |
11 | ||
11e6b3f6 JK |
12 | setup_git_directory(); |
13 | ||
c9baaf9d | 14 | if (get_oid(av[1], &hash1)) |
68faf689 | 15 | die("cannot parse %s as an object name", av[1]); |
c9baaf9d | 16 | if (get_oid(av[2], &hash2)) |
68faf689 | 17 | die("cannot parse %s as an object name", av[2]); |
a9dbc179 | 18 | one = parse_tree_indirect(&hash1); |
68faf689 | 19 | if (!one) |
bb8040f9 | 20 | die("not a tree-ish %s", av[1]); |
a9dbc179 | 21 | two = parse_tree_indirect(&hash2); |
68faf689 | 22 | if (!two) |
bb8040f9 | 23 | die("not a tree-ish %s", av[2]); |
68faf689 | 24 | |
90d34051 | 25 | shift_tree(the_repository, &one->object.oid, &two->object.oid, &shifted, -1); |
c9baaf9d | 26 | printf("shifted: %s\n", oid_to_hex(&shifted)); |
68faf689 | 27 | |
338abb0f | 28 | return 0; |
68faf689 | 29 | } |