diff options
author | Stefan Beller <sbeller@google.com> | 2018-06-28 18:22:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-29 10:43:39 -0700 |
commit | a74093da5ed601a09fa158e5ba6f6f14c1142a3e (patch) | |
tree | 6e9603b7e816566bd5e4ba1478089c992bee196e /sha1-name.c | |
parent | 0e740fed5dfd84bf0d136719d91a7764a3477d20 (diff) | |
download | git-a74093da5ed601a09fa158e5ba6f6f14c1142a3e.tar.gz |
tag: add repository argument to deref_tag
Add a repository argument to allow the callers of deref_tag
to be more specific about which repository to act on. 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: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-name.c')
-rw-r--r-- | sha1-name.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sha1-name.c b/sha1-name.c index 5854bc75fe..009faab4ae 100644 --- a/sha1-name.c +++ b/sha1-name.c @@ -239,7 +239,8 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da return 0; /* We need to do this the hard way... */ - obj = deref_tag(parse_object(the_repository, oid), NULL, 0); + obj = deref_tag(the_repository, parse_object(the_repository, oid), + NULL, 0); if (obj && obj->type == OBJ_COMMIT) return 1; return 0; @@ -263,7 +264,8 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_ return 0; /* We need to do this the hard way... */ - obj = deref_tag(parse_object(the_repository, oid), NULL, 0); + obj = deref_tag(the_repository, parse_object(the_repository, oid), + NULL, 0); if (obj && (obj->type == OBJ_TREE || obj->type == OBJ_COMMIT)) return 1; return 0; @@ -968,7 +970,7 @@ static int peel_onion(const char *name, int len, struct object_id *oid, if (!o) return -1; if (!expected_type) { - o = deref_tag(o, name, sp - name - 2); + o = deref_tag(the_repository, o, name, sp - name - 2); if (!o || (!o->parsed && !parse_object(the_repository, &o->oid))) return -1; oidcpy(oid, &o->oid); @@ -1100,7 +1102,8 @@ static int handle_one_ref(const char *path, const struct object_id *oid, if (!object) return 0; if (object->type == OBJ_TAG) { - object = deref_tag(object, path, strlen(path)); + object = deref_tag(the_repository, object, path, + strlen(path)); if (!object) return 0; } |