Merge branch 'ds/for-each-ref-is-base'
'git for-each-ref' learned a new "--format" atom to find the branch that the history leading to a given commit "%(is-base:<commit>)" is likely based on. * ds/for-each-ref-is-base: p1500: add is-base performance tests for-each-ref: add 'is-base' token commit: add gentle reference lookup method commit-reach: add get_branch_base_for_tip
This commit is contained in:
8
commit.c
8
commit.c
@ -84,13 +84,19 @@ struct commit *lookup_commit(struct repository *r, const struct object_id *oid)
|
||||
}
|
||||
|
||||
struct commit *lookup_commit_reference_by_name(const char *name)
|
||||
{
|
||||
return lookup_commit_reference_by_name_gently(name, 0);
|
||||
}
|
||||
|
||||
struct commit *lookup_commit_reference_by_name_gently(const char *name,
|
||||
int quiet)
|
||||
{
|
||||
struct object_id oid;
|
||||
struct commit *commit;
|
||||
|
||||
if (repo_get_oid_committish(the_repository, name, &oid))
|
||||
return NULL;
|
||||
commit = lookup_commit_reference(the_repository, &oid);
|
||||
commit = lookup_commit_reference_gently(the_repository, &oid, quiet);
|
||||
if (repo_parse_commit(the_repository, commit))
|
||||
return NULL;
|
||||
return commit;
|
||||
|
Reference in New Issue
Block a user