From 8f56e9d4baa836a4a3cd56767457d6122de7ce1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 6 Apr 2019 18:34:26 +0700 Subject: refs.c: remove the_repo from substitute_branch_name() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- refs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index 3dde824aab..44df049796 100644 --- a/refs.c +++ b/refs.c @@ -539,10 +539,11 @@ void expand_ref_prefix(struct argv_array *prefixes, const char *prefix) * later free()ing) if the string passed in is a magic short-hand form * to name a branch. */ -static char *substitute_branch_name(const char **string, int *len) +static char *substitute_branch_name(struct repository *r, + const char **string, int *len) { struct strbuf buf = STRBUF_INIT; - int ret = interpret_branch_name(*string, *len, &buf, 0); + int ret = repo_interpret_branch_name(r, *string, *len, &buf, 0); if (ret == *len) { size_t size; @@ -556,7 +557,7 @@ static char *substitute_branch_name(const char **string, int *len) int dwim_ref(const char *str, int len, struct object_id *oid, char **ref) { - char *last_branch = substitute_branch_name(&str, &len); + char *last_branch = substitute_branch_name(the_repository, &str, &len); int refs_found = expand_ref(str, len, oid, ref); free(last_branch); return refs_found; @@ -596,7 +597,7 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref) int dwim_log(const char *str, int len, struct object_id *oid, char **log) { - char *last_branch = substitute_branch_name(&str, &len); + char *last_branch = substitute_branch_name(the_repository, &str, &len); const char **p; int logs_found = 0; struct strbuf path = STRBUF_INIT; -- cgit v1.2.1