Introduce old redir program
[lcapit-junk-code.git] / git / resolve-ref.c
blobfc7e60c8a877c1c7fe92a1e3a6722d61904fc201
1 #include <cache.h>
3 int main(int argc, char *argv[])
5 int err;
6 char *hex;
7 unsigned char sha1[20];
9 if (argc != 2) {
10 printf("usage: resolve-ref <ref>");
11 exit(1);
14 err = get_sha1(argv[1], sha1);
15 if (err) {
16 perror("get_sha1()");
17 exit(1);
20 hex = sha1_to_hex(sha1);
21 if (!hex) {
22 perror("sha1_to_hex()");
23 exit(1);
26 printf("%s\n", hex);
28 return 0;