aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-04-25 00:45:09 +0200
committerJunio C Hamano <gitster@pobox.com>2012-05-03 13:15:09 -0700
commit66a3d20b8f8566581e8aa46e35555f353074f232 (patch)
treec3744a6c0140157c198a85449c5e1c2a0876cc69 /refs.c
parent72b64b44e77112b93e7b046e54c62a01e69cef3d (diff)
downloadgit-66a3d20b8f8566581e8aa46e35555f353074f232.tar.gz
git-66a3d20b8f8566581e8aa46e35555f353074f232.tar.xz
get_ref_dir(): rename "base" parameter to "dirname"
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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/refs.c b/refs.c
index ed6d84230..37ea557f3 100644
--- 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));
}
-static void get_ref_dir(struct ref_cache *refs, const char *base,
+static void get_ref_dir(struct ref_cache *refs, const char *dirname,
struct ref_dir *dir)
{
DIR *d;
const char *path;
struct dirent *de;
- int baselen;
+ int dirnamelen;
struct strbuf refname;
if (*refs->name)
- path = git_path_submodule(refs->name, "%s", base);
+ path = git_path_submodule(refs->name, "%s", dirname);
else
- path = git_path("%s", base);
+ path = git_path("%s", dirname);
d = opendir(path);
if (!d)
return;
- baselen = strlen(base);
- strbuf_init(&refname, baselen + 257);
- strbuf_add(&refname, base, baselen);
- if (baselen && base[baselen-1] != '/') {
+ dirnamelen = strlen(dirname);
+ strbuf_init(&refname, dirnamelen + 257);
+ strbuf_add(&refname, dirname, dirnamelen);
+ if (dirnamelen && dirname[dirnamelen-1] != '/') {
strbuf_addch(&refname, '/');
- baselen++;
+ dirnamelen++;
}
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));
}
- strbuf_setlen(&refname, baselen);
+ strbuf_setlen(&refname, dirnamelen);
}
strbuf_release(&refname);
closedir(d);