Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
get_ref_dir(): rename "base" parameter to "dirname"
author
Michael Haggerty
<mhagger@alum.mit.edu>
Tue, 24 Apr 2012 22:45:09 +0000
(
00:45
+0200)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 3 May 2012 20:15:09 +0000
(13:15 -0700)
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:
72b64b4
)
diff --git
a/refs.c
b/refs.c
index ed6d84230da4aac6aec2875c7fe181905f73b1eb..37ea557f3e843548d8418c51ec283aa05d4a4c14 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-749,30
+749,30
@@
void add_packed_ref(const char *refname, const unsigned char *sha1)
create_ref_entry(refname, sha1, REF_ISPACKED, 1));
}
create_ref_entry(refname, sha1, REF_ISPACKED, 1));
}
-static void get_ref_dir(struct ref_cache *refs, const char *
bas
e,
+static void get_ref_dir(struct ref_cache *refs, const char *
dirnam
e,
struct ref_dir *dir)
{
DIR *d;
const char *path;
struct dirent *de;
struct ref_dir *dir)
{
DIR *d;
const char *path;
struct dirent *de;
- int
bas
elen;
+ int
dirnam
elen;
struct strbuf refname;
if (*refs->name)
struct strbuf refname;
if (*refs->name)
- path = git_path_submodule(refs->name, "%s",
bas
e);
+ path = git_path_submodule(refs->name, "%s",
dirnam
e);
else
else
- path = git_path("%s",
bas
e);
+ path = git_path("%s",
dirnam
e);
d = opendir(path);
if (!d)
return;
d = opendir(path);
if (!d)
return;
-
baselen = strlen(bas
e);
- strbuf_init(&refname,
bas
elen + 257);
- strbuf_add(&refname,
base, bas
elen);
- if (
baselen && base[bas
elen-1] != '/') {
+
dirnamelen = strlen(dirnam
e);
+ strbuf_init(&refname,
dirnam
elen + 257);
+ strbuf_add(&refname,
dirname, dirnam
elen);
+ if (
dirnamelen && dirname[dirnam
elen-1] != '/') {
strbuf_addch(&refname, '/');
strbuf_addch(&refname, '/');
-
bas
elen++;
+
dirnam
elen++;
}
while ((de = readdir(d)) != NULL) {
}
while ((de = readdir(d)) != NULL) {
@@
-807,7
+807,7
@@
static void get_ref_dir(struct ref_cache *refs, const char *base,
}
add_ref(dir, create_ref_entry(refname.buf, sha1, flag, 1));
}
}
add_ref(dir, create_ref_entry(refname.buf, sha1, flag, 1));
}
- strbuf_setlen(&refname,
bas
elen);
+ strbuf_setlen(&refname,
dirnam
elen);
}
strbuf_release(&refname);
closedir(d);
}
strbuf_release(&refname);
closedir(d);