You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
627 B
27 lines
627 B
![]()
18 years ago
|
#include "cache.h"
|
||
|
#include "tree.h"
|
||
|
|
||
![]()
9 years ago
|
int cmd_main(int ac, const char **av)
|
||
![]()
18 years ago
|
{
|
||
![]()
9 years ago
|
struct object_id hash1, hash2, shifted;
|
||
![]()
18 years ago
|
struct tree *one, *two;
|
||
|
|
||
![]()
9 years ago
|
setup_git_directory();
|
||
|
|
||
![]()
9 years ago
|
if (get_oid(av[1], &hash1))
|
||
![]()
18 years ago
|
die("cannot parse %s as an object name", av[1]);
|
||
![]()
9 years ago
|
if (get_oid(av[2], &hash2))
|
||
![]()
18 years ago
|
die("cannot parse %s as an object name", av[2]);
|
||
![]()
9 years ago
|
one = parse_tree_indirect(hash1.hash);
|
||
![]()
18 years ago
|
if (!one)
|
||
![]()
12 years ago
|
die("not a tree-ish %s", av[1]);
|
||
![]()
9 years ago
|
two = parse_tree_indirect(hash2.hash);
|
||
![]()
18 years ago
|
if (!two)
|
||
![]()
12 years ago
|
die("not a tree-ish %s", av[2]);
|
||
![]()
18 years ago
|
|
||
![]()
9 years ago
|
shift_tree(&one->object.oid, &two->object.oid, &shifted, -1);
|
||
![]()
9 years ago
|
printf("shifted: %s\n", oid_to_hex(&shifted));
|
||
![]()
18 years ago
|
|
||
|
exit(0);
|
||
|
}
|