repo.or.cz
/
lcapit-junk-code.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Introduce old redir program
[lcapit-junk-code.git]
/
git
/
resolve-ref.c
blob
fc7e60c8a877c1c7fe92a1e3a6722d61904fc201
1
#include <cache.h>
2
3
int
main
(
int
argc
,
char
*
argv
[])
4
{
5
int
err
;
6
char
*
hex
;
7
unsigned char
sha1
[
20
];
8
9
if
(
argc
!=
2
) {
10
printf
(
"usage: resolve-ref <ref>"
);
11
exit
(
1
);
12
}
13
14
err
=
get_sha1
(
argv
[
1
],
sha1
);
15
if
(
err
) {
16
perror
(
"get_sha1()"
);
17
exit
(
1
);
18
}
19
20
hex
=
sha1_to_hex
(
sha1
);
21
if
(!
hex
) {
22
perror
(
"sha1_to_hex()"
);
23
exit
(
1
);
24
}
25
26
printf
(
"%s
\n
"
,
hex
);
27
28
return
0
;
29
}