summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-04-06 11:34:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-08 08:26:33 (GMT)
commit0b1dbf53dfeed20bd9bc34631e04c5db37ee6121 (patch)
tree782966b0d584c2a48f59630d7330f2ef1b109bd1 /refs.c
parent8f56e9d4baa836a4a3cd56767457d6122de7ce1d (diff)
downloadgit-0b1dbf53dfeed20bd9bc34631e04c5db37ee6121.zip
git-0b1dbf53dfeed20bd9bc34631e04c5db37ee6121.tar.gz
git-0b1dbf53dfeed20bd9bc34631e04c5db37ee6121.tar.bz2
refs.c: remove the_repo from expand_ref()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/refs.c b/refs.c
index 44df049..1f5864a 100644
--- a/refs.c
+++ b/refs.c
@@ -558,12 +558,13 @@ static char *substitute_branch_name(struct repository *r,
int dwim_ref(const char *str, int len, struct object_id *oid, char **ref)
{
char *last_branch = substitute_branch_name(the_repository, &str, &len);
- int refs_found = expand_ref(str, len, oid, ref);
+ int refs_found = expand_ref(the_repository, str, len, oid, ref);
free(last_branch);
return refs_found;
}
-int expand_ref(const char *str, int len, struct object_id *oid, char **ref)
+int expand_ref(struct repository *repo, const char *str, int len,
+ struct object_id *oid, char **ref)
{
const char **p, *r;
int refs_found = 0;
@@ -578,8 +579,9 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref)
this_result = refs_found ? &oid_from_ref : oid;
strbuf_reset(&fullref);
strbuf_addf(&fullref, *p, len, str);
- r = resolve_ref_unsafe(fullref.buf, RESOLVE_REF_READING,
- this_result, &flag);
+ r = refs_resolve_ref_unsafe(get_main_ref_store(repo),
+ fullref.buf, RESOLVE_REF_READING,
+ this_result, &flag);
if (r) {
if (!refs_found++)
*ref = xstrdup(r);