summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-09-04 18:08:24 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:13 -0700
commita8355bb717aaf2d5d9b3781aa78402d0053fa87a (patch)
treee692727ab490713e6f8da84837f4461115ed6206 /refs.c
parent48a8475fd3f935d753cc2e0dd81562bc73f6d6d3 (diff)
downloadgit-a8355bb717aaf2d5d9b3781aa78402d0053fa87a.tar.gz
resolve_gitlink_ref(): rename path parameter to submodule
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/refs.c b/refs.c
index 17f3497a0b..1a2a2bbbe7 100644
--- a/refs.c
+++ b/refs.c
@@ -1299,26 +1299,27 @@ const char *resolve_ref_unsafe(const char *refname, int resolve_flags,
resolve_flags, sha1, flags);
}
-int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *sha1)
+int resolve_gitlink_ref(const char *submodule, const char *refname,
+ unsigned char *sha1)
{
- size_t len = strlen(path);
+ size_t len = strlen(submodule);
struct ref_store *refs;
int flags;
- while (len && path[len - 1] == '/')
+ while (len && submodule[len - 1] == '/')
len--;
if (!len)
return -1;
- if (path[len]) {
+ if (submodule[len]) {
/* We need to strip off one or more trailing slashes */
- char *stripped = xmemdupz(path, len);
+ char *stripped = xmemdupz(submodule, len);
refs = get_ref_store(stripped);
free(stripped);
} else {
- refs = get_ref_store(path);
+ refs = get_ref_store(submodule);
}
if (!refs)