aboutsummaryrefslogtreecommitdiffstats
path: root/object-name.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-03-12 16:56:07 +0100
committerJunio C Hamano <gitster@pobox.com>2025-03-12 11:31:16 -0700
commit37e7546b91fb7d7c263d809dbf7d85831c15cc4f (patch)
tree13c4573c56f1bdbb3daaad9b5ec956b152cd3bf3 /object-name.h
parent08bdfd453584e489d5a551aecbdcb77584e1b958 (diff)
downloadgit-37e7546b91fb7d7c263d809dbf7d85831c15cc4f.tar.gz
object-name: introduce `repo_get_oid_with_flags()`
Introduce a new function `repo_get_oid_with_flags()`. This function behaves the same as `repo_get_oid()`, except that it takes an extra `flags` parameter that it ends up passing to `get_oid_with_context()`. This function will be used in a subsequent commit. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-name.h')
-rw-r--r--object-name.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/object-name.h b/object-name.h
index 8dba4a47a4..cda4934cd5 100644
--- a/object-name.h
+++ b/object-name.h
@@ -51,6 +51,12 @@ void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,
void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
int abbrev_len);
+/*
+ * This is like "get_oid_basic()", except it allows "object ID expressions",
+ * notably "xyz^" for "parent of xyz". Accepts GET_OID_* flags.
+ */
+int repo_get_oid_with_flags(struct repository *r, const char *str,
+ struct object_id *oid, unsigned flags);
int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
__attribute__((format (printf, 2, 3)))
int get_oidf(struct object_id *oid, const char *fmt, ...);