Signed-off-by: Michael Haggerty <[email protected]>
---
refs.c | 11 ++++++-----
refs.h | 9 +++++----
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/refs.c b/refs.c
index 7a8ef6d..c39f85a 100644
--- a/refs.c
+++ b/refs.c
@@ -1299,22 +1299,23 @@ 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, orig_len = strlen(path);
+ size_t len, orig_len = strlen(submodule);
struct ref_store *refs;
int flags;
- for (len = orig_len; len && path[len - 1] == '/'; len--)
+ for (len = orig_len; len && submodule[len - 1] == '/'; len--)
;
if (!len)
return -1;
if (len == orig_len) {
- refs = get_ref_store(path);
+ refs = get_ref_store(submodule);
} else {
- char *stripped = xmemdupz(path, len);
+ char *stripped = xmemdupz(submodule, len);
refs = get_ref_store(stripped);
free(stripped);
diff --git a/refs.h b/refs.h
index 52ea93b..132dcef 100644
--- a/refs.h
+++ b/refs.h
@@ -77,11 +77,12 @@ int is_branch(const char *refname);
int peel_ref(const char *refname, unsigned char *sha1);
/**
- * Resolve refname in the nested "gitlink" repository that is located
- * at path. If the resolution is successful, return 0 and set sha1 to
- * the name of the object; otherwise, return a non-zero value.
+ * Resolve refname in the nested "gitlink" repository in the specified
+ * submodule (which must be non-NULL). If the resolution is
+ * successful, return 0 and set sha1 to the name of the object;
+ * otherwise, return a non-zero value.
*/
-int resolve_gitlink_ref(const char *path, const char *refname,
+int resolve_gitlink_ref(const char *submodule, const char *refname,
unsigned char *sha1);
/*
--
2.8.1
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html