X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=commit.h;h=14f6a5a2ed91e2176cce4543798774f88a8628b1;hb=4b340593551217904d794cc0a8db55db89b5b066;hp=12d100b8b6fcd092f3a6886a75c720011ef1b7dc;hpb=fee6bc5f031a9d18d09463d96d7df562d62438f7;p=git.git diff --git a/commit.h b/commit.h index 12d100b8b..14f6a5a2e 100644 --- a/commit.h +++ b/commit.h @@ -38,6 +38,13 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1, int quiet); struct commit *lookup_commit_reference_by_name(const char *name); +/* + * Look up object named by "sha1", dereference tag as necessary, + * get a commit and return it. If "sha1" does not dereference to + * a commit, use ref_name to report an error and die. + */ +struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_name); + int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size); int parse_commit(struct commit *item);