summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-26 11:32:24 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-26 11:32:24 -0700
commit3222718ad7d9dfc50e31037bf2f3977d2071fb75 (patch)
treefb2bd5fb5cd5d53c84daa07b3a0d6356b3a59583 /commit.c
parent3dd2a2feca6e47b2931dadadad44f92a35e8cf51 (diff)
parent4b707a6e99651b1ba7c8718f95ee57c6721c85d6 (diff)
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
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 24ab5c1b50..3238772f52 100644
--- a/commit.c
+++ b/commit.c
@@ -85,12 +85,18 @@ 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;