strbuf_release(&ctx->symlink_path);
}
-/*
- * This is like "get_oid_basic()", except it allows "object ID expressions",
- * notably "xyz^" for "parent of xyz"
- */
-int repo_get_oid(struct repository *r, const char *name, struct object_id *oid)
+int repo_get_oid_with_flags(struct repository *r, const char *name,
+ struct object_id *oid, unsigned flags)
{
struct object_context unused;
- int ret = get_oid_with_context(r, name, 0, oid, &unused);
+ int ret = get_oid_with_context(r, name, flags, oid, &unused);
object_context_release(&unused);
return ret;
}
+int repo_get_oid(struct repository *r, const char *name, struct object_id *oid)
+{
+ return repo_get_oid_with_flags(r, name, oid, 0);
+}
+
/*
* This returns a non-zero value if the string (built using printf
* format and the given arguments) is not a valid object.
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, ...);