aboutsummaryrefslogtreecommitdiffstats
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-10-17 12:54:27 -0700
committerJunio C Hamano <gitster@pobox.com>2022-10-17 12:54:27 -0700
commita524c627a424171c9cc2be2258725adc3f0bcc5a (patch)
tree9699e6c34eb24a9b2d9981c303b4b8e2a89ba489 /commit.c
parentMerge a handful of topics from the 'master' front (diff)
parentrebase --keep-base: imply --no-fork-point (diff)
downloadgit-a524c627a424171c9cc2be2258725adc3f0bcc5a.tar.gz
git-a524c627a424171c9cc2be2258725adc3f0bcc5a.zip
Merge branch 'pw/rebase-keep-base-fixes' into pw/rebase-reflog-fixes
* pw/rebase-keep-base-fixes: rebase --keep-base: imply --no-fork-point rebase --keep-base: imply --reapply-cherry-picks rebase: factor out branch_base calculation rebase: rename merge_base to branch_base rebase: store orig_head as a commit rebase: be stricter when reading state files containing oids t3416: set $EDITOR in subshell t3416: tighten two tests
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index 1fb1b2ea90..874b3014b5 100644
--- a/commit.c
+++ b/commit.c
@@ -59,6 +59,14 @@ struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref
return c;
}
+struct commit *lookup_commit_object(struct repository *r,
+ const struct object_id *oid)
+{
+ struct object *obj = parse_object(r, oid);
+ return obj ? object_as_type(obj, OBJ_COMMIT, 0) : NULL;
+
+}
+
struct commit *lookup_commit(struct repository *r, const struct object_id *oid)
{
struct object *obj = lookup_object(r, oid);