Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
resolve_gitlink_ref(): rename path parameter to submodule
author
Michael Haggerty
<mhagger@alum.mit.edu>
Sun, 4 Sep 2016 16:08:24 +0000
(18:08 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 9 Sep 2016 22:28:13 +0000
(15:28 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
refs.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
48a8475
)
diff --git
a/refs.c
b/refs.c
index 17f3497a0b5b6d82fd78e7f00b1c1834c67c1611..1a2a2bbbe775618a77919c93eb304f1445e09eee 100644
(file)
--- 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);
}
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;
struct ref_store *refs;
int flags;
- while (len &&
path
[len - 1] == '/')
+ while (len &&
submodule
[len - 1] == '/')
len--;
if (!len)
return -1;
len--;
if (!len)
return -1;
- if (
path
[len]) {
+ if (
submodule
[len]) {
/* We need to strip off one or more trailing slashes */
/* 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(stripped);
free(stripped);
} else {
- refs = get_ref_store(
path
);
+ refs = get_ref_store(
submodule
);
}
if (!refs)
}
if (!refs)
diff --git
a/refs.h
b/refs.h
index 52ea93b8c36cc64a60a0009a8619dae017effba8..132dcef5afa3de3e6e17d259d1d5c9e995041b84 100644
(file)
--- 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);
/**
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);
/*
unsigned char *sha1);
/*