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>2017-08-23 15:36:50 +0300
committerJunio C Hamano <gitster@pobox.com>2017-08-25 00:42:24 +0300
commitee394bd376e833d8e9e38f81c57f6b4a370e8a92 (patch)
treead41e65c5b10d9034c521d97d899acfea0f34dc3 /refs.c
parentff9445be4702d6cf6e5e8c202a15066ca355989b (diff)
refs.c: use is_dir_sep() in resolve_gitlink_ref()
The "submodule" argument in this function is a path, which can have either '/' or '\\' as a separator. Use is_dir_sep() to support both. Noticed-by: Johannes Sixt <j6t@kdbg.org> 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 3d549a8970..dec899a57a 100644
--- a/refs.c
+++ b/refs.c
@@ -1507,7 +1507,7 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
struct ref_store *refs;
int flags;
- while (len && submodule[len - 1] == '/')
+ while (len && is_dir_sep(submodule[len - 1]))
len--;
if (!len)