t / helper / test-match-trees.con commit Merge branch 'ew/http-do-not-forget-to-call-curl-multi-remove-handle' (ac8ddd7)
   1#include "cache.h"
   2#include "tree.h"
   3
   4int cmd_main(int ac, const char **av)
   5{
   6        struct object_id hash1, hash2, shifted;
   7        struct tree *one, *two;
   8
   9        setup_git_directory();
  10
  11        if (get_oid(av[1], &hash1))
  12                die("cannot parse %s as an object name", av[1]);
  13        if (get_oid(av[2], &hash2))
  14                die("cannot parse %s as an object name", av[2]);
  15        one = parse_tree_indirect(hash1.hash);
  16        if (!one)
  17                die("not a tree-ish %s", av[1]);
  18        two = parse_tree_indirect(hash2.hash);
  19        if (!two)
  20                die("not a tree-ish %s", av[2]);
  21
  22        shift_tree(&one->object.oid, &two->object.oid, &shifted, -1);
  23        printf("shifted: %s\n", oid_to_hex(&shifted));
  24
  25        exit(0);
  26}