diff options
author | Stefan Beller <sbeller@google.com> | 2018-04-25 11:20:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-26 10:54:27 +0900 |
commit | 0df8e96566ddcae4adc4efc096944c064f60b8bd (patch) | |
tree | 19c8b0277b21dcd9a9baa71ca5541bd59853afae /sha1_name.c | |
parent | cache.h: add repository argument to oid_object_info_extended (diff) | |
download | tgif-0df8e96566ddcae4adc4efc096944c064f60b8bd.tar.xz |
cache.h: add repository argument to oid_object_info
Add a repository argument to allow the callers of oid_object_info
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.
As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r-- | sha1_name.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sha1_name.c b/sha1_name.c index 5b93bf8da3..b5406b6eb2 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -223,7 +223,7 @@ static int finish_object_disambiguation(struct disambiguate_state *ds, static int disambiguate_commit_only(const struct object_id *oid, void *cb_data_unused) { - int kind = oid_object_info(oid, NULL); + int kind = oid_object_info(the_repository, oid, NULL); return kind == OBJ_COMMIT; } @@ -232,7 +232,7 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da struct object *obj; int kind; - kind = oid_object_info(oid, NULL); + kind = oid_object_info(the_repository, oid, NULL); if (kind == OBJ_COMMIT) return 1; if (kind != OBJ_TAG) @@ -247,7 +247,7 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da static int disambiguate_tree_only(const struct object_id *oid, void *cb_data_unused) { - int kind = oid_object_info(oid, NULL); + int kind = oid_object_info(the_repository, oid, NULL); return kind == OBJ_TREE; } @@ -256,7 +256,7 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_ struct object *obj; int kind; - kind = oid_object_info(oid, NULL); + kind = oid_object_info(the_repository, oid, NULL); if (kind == OBJ_TREE || kind == OBJ_COMMIT) return 1; if (kind != OBJ_TAG) @@ -271,7 +271,7 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_ static int disambiguate_blob_only(const struct object_id *oid, void *cb_data_unused) { - int kind = oid_object_info(oid, NULL); + int kind = oid_object_info(the_repository, oid, NULL); return kind == OBJ_BLOB; } @@ -350,7 +350,7 @@ static int show_ambiguous_object(const struct object_id *oid, void *data) if (ds->fn && !ds->fn(oid, ds->cb_data)) return 0; - type = oid_object_info(oid, NULL); + type = oid_object_info(the_repository, oid, NULL); if (type == OBJ_COMMIT) { struct commit *commit = lookup_commit(oid); if (commit) { |