Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-04-06 14:34:28 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-08 11:26:33 +0300
commitd8984c532a18419cdbc69641f981a0a4f553729c (patch)
tree508b004b8995e7b0355f92258530f9f4f14b17d1 /refs.c
parent0b1dbf53dfeed20bd9bc34631e04c5db37ee6121 (diff)
refs.c: add repo_dwim_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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 1f5864aa36..bd0fec5776 100644
--- a/refs.c
+++ b/refs.c
@@ -555,14 +555,20 @@ static char *substitute_branch_name(struct repository *r,
return NULL;
}
-int dwim_ref(const char *str, int len, struct object_id *oid, char **ref)
+int repo_dwim_ref(struct repository *r, 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(the_repository, str, len, oid, ref);
+ char *last_branch = substitute_branch_name(r, &str, &len);
+ int refs_found = expand_ref(r, str, len, oid, ref);
free(last_branch);
return refs_found;
}
+int dwim_ref(const char *str, int len, struct object_id *oid, char **ref)
+{
+ return repo_dwim_ref(the_repository, str, len, oid, ref);
+}
+
int expand_ref(struct repository *repo, const char *str, int len,
struct object_id *oid, char **ref)
{