forked from chrissimpkins/codeface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsamplecode.c
More file actions
20 lines (12 loc) · 399 Bytes
/
samplecode.c
File metadata and controls
20 lines (12 loc) · 399 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// sample code from commit.c of the Git repository (https://github.com/git)
struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_name)
{
struct commit *c = lookup_commit_reference(sha1);
if (!c)
die(_("could not parse %s"), ref_name);
if (hashcmp(sha1, c->object.sha1)) {
warning(_("%s %s is not a commit!"),
ref_name, sha1_to_hex(sha1));
}
return c;
}