Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
get_ref_dir(): change signature
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 12 Dec 2011 05:38:17 +0000
(06:38 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 12 Dec 2011 17:08:53 +0000
(09:08 -0800)
Change get_ref_dir() to take a (struct ref_cache *) in place of the
submodule name.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
316b097
)
diff --git
a/refs.c
b/refs.c
index c62c682def18027993c1dbc9f26100311c92400b..91ec3954b78d59000cad99fdeea2761d1f0831b4 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-298,14
+298,14
@@
static struct ref_array *get_packed_refs(struct ref_cache *refs)
return &refs->packed;
}
return &refs->packed;
}
-static void get_ref_dir(
const char *submodule
, const char *base,
+static void get_ref_dir(
struct ref_cache *refs
, const char *base,
struct ref_array *array)
{
DIR *dir;
const char *path;
struct ref_array *array)
{
DIR *dir;
const char *path;
- if (*
submodul
e)
- path = git_path_submodule(
submodul
e, "%s", base);
+ if (*
refs->nam
e)
+ path = git_path_submodule(
refs->nam
e, "%s", base);
else
path = git_path("%s", base);
else
path = git_path("%s", base);
@@
-336,19
+336,19
@@
static void get_ref_dir(const char *submodule, const char *base,
if (has_extension(de->d_name, ".lock"))
continue;
memcpy(refname + baselen, de->d_name, namelen+1);
if (has_extension(de->d_name, ".lock"))
continue;
memcpy(refname + baselen, de->d_name, namelen+1);
- refdir =
submodul
e
- ? git_path_submodule(
submodul
e, "%s", refname)
+ refdir =
*refs->nam
e
+ ? git_path_submodule(
refs->nam
e, "%s", refname)
: git_path("%s", refname);
if (stat(refdir, &st) < 0)
continue;
if (S_ISDIR(st.st_mode)) {
: git_path("%s", refname);
if (stat(refdir, &st) < 0)
continue;
if (S_ISDIR(st.st_mode)) {
- get_ref_dir(
submodule
, refname, array);
+ get_ref_dir(
refs
, refname, array);
continue;
}
continue;
}
- if (
submodul
e) {
+ if (
*refs->nam
e) {
hashclr(sha1);
flag = 0;
hashclr(sha1);
flag = 0;
- if (resolve_gitlink_ref(
submodul
e, refname, sha1) < 0) {
+ if (resolve_gitlink_ref(
refs->nam
e, refname, sha1) < 0) {
hashclr(sha1);
flag |= REF_ISBROKEN;
}
hashclr(sha1);
flag |= REF_ISBROKEN;
}
@@
-400,7
+400,7
@@
void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname)
static struct ref_array *get_loose_refs(struct ref_cache *refs)
{
if (!refs->did_loose) {
static struct ref_array *get_loose_refs(struct ref_cache *refs)
{
if (!refs->did_loose) {
- get_ref_dir(refs
->name
, "refs", &refs->loose);
+ get_ref_dir(refs, "refs", &refs->loose);
sort_ref_array(&refs->loose);
refs->did_loose = 1;
}
sort_ref_array(&refs->loose);
refs->did_loose = 1;
}