4 * Copyright (C) Linus Torvalds, 2005
8 int main(int argc
, char **argv
)
12 unsigned char sha1
[20];
14 for (i
= 1; i
< argc
; i
++) {
23 if (!strcmp(arg
, "--")) {
30 if (!strcmp(arg
, "--default")) {
41 if (!get_sha1(arg
, sha1
)) {
42 printf("%s\n", sha1_to_hex(sha1
));
45 if (*arg
== '^' && !get_sha1(arg
+1, sha1
)) {
46 printf("^%s\n", sha1_to_hex(sha1
));
49 dotdot
= strstr(arg
, "..");
51 unsigned char end
[20];
54 if (!get_sha1(arg
, sha1
)) {
57 if (!get_sha1(n
, end
)) {
58 printf("%s\n", sha1_to_hex(end
));
59 printf("^%s\n", sha1_to_hex(sha1
));