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