]> git.ipfire.org Git - thirdparty/git.git/blame - t/helper/test-match-trees.c
Merge branch 'jk/bundle-use-dash-for-stdfiles'
[thirdparty/git.git] / t / helper / test-match-trees.c
CommitLineData
9080e75f 1#include "test-tool.h"
68faf689 2#include "cache.h"
41771fa4 3#include "hex.h"
68faf689
JH
4#include "tree.h"
5
9080e75f 6int cmd__match_trees(int ac, const char **av)
68faf689 7{
c9baaf9d 8 struct object_id hash1, hash2, shifted;
68faf689
JH
9 struct tree *one, *two;
10
11e6b3f6
JK
11 setup_git_directory();
12
c9baaf9d 13 if (get_oid(av[1], &hash1))
68faf689 14 die("cannot parse %s as an object name", av[1]);
c9baaf9d 15 if (get_oid(av[2], &hash2))
68faf689 16 die("cannot parse %s as an object name", av[2]);
a9dbc179 17 one = parse_tree_indirect(&hash1);
68faf689 18 if (!one)
bb8040f9 19 die("not a tree-ish %s", av[1]);
a9dbc179 20 two = parse_tree_indirect(&hash2);
68faf689 21 if (!two)
bb8040f9 22 die("not a tree-ish %s", av[2]);
68faf689 23
90d34051 24 shift_tree(the_repository, &one->object.oid, &two->object.oid, &shifted, -1);
c9baaf9d 25 printf("shifted: %s\n", oid_to_hex(&shifted));
68faf689 26
338abb0f 27 return 0;
68faf689 28}