diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-09-23 11:53:40 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-23 11:53:40 -0700 |
| commit | 7c15d990cc05837ddcbcb41dc8f64ea2a7405226 (patch) | |
| tree | bc6c6b0573de3352369005f9f0601386f23ff27d /object-name.c | |
| parent | 2e8d7569eae06a7e5052d08c2697b0f1281be9da (diff) | |
| parent | a66fc22bf9b7f379fc68e23c54d42ac9b7eaa845 (diff) | |
| download | git-7c15d990cc05837ddcbcb41dc8f64ea2a7405226.tar.xz | |
Merge branch 'rs/get-oid-with-flags-cleanup'
Code clean-up.
* rs/get-oid-with-flags-cleanup:
use repo_get_oid_with_flags()
Diffstat (limited to 'object-name.c')
| -rw-r--r-- | object-name.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/object-name.c b/object-name.c index 4407f67ff8..7774991d28 100644 --- a/object-name.c +++ b/object-name.c @@ -1857,55 +1857,35 @@ int repo_get_oid_committish(struct repository *r, const char *name, struct object_id *oid) { - struct object_context unused; - int ret = get_oid_with_context(r, name, GET_OID_COMMITTISH, - oid, &unused); - object_context_release(&unused); - return ret; + return repo_get_oid_with_flags(r, name, oid, GET_OID_COMMITTISH); } int repo_get_oid_treeish(struct repository *r, const char *name, struct object_id *oid) { - struct object_context unused; - int ret = get_oid_with_context(r, name, GET_OID_TREEISH, - oid, &unused); - object_context_release(&unused); - return ret; + return repo_get_oid_with_flags(r, name, oid, GET_OID_TREEISH); } int repo_get_oid_commit(struct repository *r, const char *name, struct object_id *oid) { - struct object_context unused; - int ret = get_oid_with_context(r, name, GET_OID_COMMIT, - oid, &unused); - object_context_release(&unused); - return ret; + return repo_get_oid_with_flags(r, name, oid, GET_OID_COMMIT); } int repo_get_oid_tree(struct repository *r, const char *name, struct object_id *oid) { - struct object_context unused; - int ret = get_oid_with_context(r, name, GET_OID_TREE, - oid, &unused); - object_context_release(&unused); - return ret; + return repo_get_oid_with_flags(r, name, oid, GET_OID_TREE); } int repo_get_oid_blob(struct repository *r, const char *name, struct object_id *oid) { - struct object_context unused; - int ret = get_oid_with_context(r, name, GET_OID_BLOB, - oid, &unused); - object_context_release(&unused); - return ret; + return repo_get_oid_with_flags(r, name, oid, GET_OID_BLOB); } /* Must be called only when object_name:filename doesn't exist. */ |
