Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
init-db: rename 'template' variables
author
Brandon Williams
<bmwill@google.com>
Wed, 14 Feb 2018 18:59:52 +0000
(10:59 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 22 Feb 2018 18:08:05 +0000
(10:08 -0800)
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/init-db.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
69caed5
)
diff --git
a/builtin/init-db.c
b/builtin/init-db.c
index c9b7946bade9e10f799942137480e71ee3233701..68ff4ad75ace6566a233c1343fed93365c5abbe4 100644
(file)
--- a/
builtin/init-db.c
+++ b/
builtin/init-db.c
@@
-24,11
+24,11
@@
static int init_is_bare_repository = 0;
static int init_shared_repository = -1;
static const char *init_db_template_dir;
static int init_shared_repository = -1;
static const char *init_db_template_dir;
-static void copy_templates_1(struct strbuf *path, struct strbuf *template,
+static void copy_templates_1(struct strbuf *path, struct strbuf *template
_path
,
DIR *dir)
{
size_t path_baselen = path->len;
DIR *dir)
{
size_t path_baselen = path->len;
- size_t template_baselen = template->len;
+ size_t template_baselen = template
_path
->len;
struct dirent *de;
/* Note: if ".git/hooks" file exists in the repository being
struct dirent *de;
/* Note: if ".git/hooks" file exists in the repository being
@@
-44,12
+44,12
@@
static void copy_templates_1(struct strbuf *path, struct strbuf *template,
int exists = 0;
strbuf_setlen(path, path_baselen);
int exists = 0;
strbuf_setlen(path, path_baselen);
- strbuf_setlen(template, template_baselen);
+ strbuf_setlen(template
_path
, template_baselen);
if (de->d_name[0] == '.')
continue;
strbuf_addstr(path, de->d_name);
if (de->d_name[0] == '.')
continue;
strbuf_addstr(path, de->d_name);
- strbuf_addstr(template, de->d_name);
+ strbuf_addstr(template
_path
, de->d_name);
if (lstat(path->buf, &st_git)) {
if (errno != ENOENT)
die_errno(_("cannot stat '%s'"), path->buf);
if (lstat(path->buf, &st_git)) {
if (errno != ENOENT)
die_errno(_("cannot stat '%s'"), path->buf);
@@
-57,36
+57,36
@@
static void copy_templates_1(struct strbuf *path, struct strbuf *template,
else
exists = 1;
else
exists = 1;
- if (lstat(template->buf, &st_template))
- die_errno(_("cannot stat template '%s'"), template->buf);
+ if (lstat(template
_path
->buf, &st_template))
+ die_errno(_("cannot stat template '%s'"), template
_path
->buf);
if (S_ISDIR(st_template.st_mode)) {
if (S_ISDIR(st_template.st_mode)) {
- DIR *subdir = opendir(template->buf);
+ DIR *subdir = opendir(template
_path
->buf);
if (!subdir)
if (!subdir)
- die_errno(_("cannot opendir '%s'"), template->buf);
+ die_errno(_("cannot opendir '%s'"), template
_path
->buf);
strbuf_addch(path, '/');
strbuf_addch(path, '/');
- strbuf_addch(template, '/');
- copy_templates_1(path, template, subdir);
+ strbuf_addch(template
_path
, '/');
+ copy_templates_1(path, template
_path
, subdir);
closedir(subdir);
}
else if (exists)
continue;
else if (S_ISLNK(st_template.st_mode)) {
struct strbuf lnk = STRBUF_INIT;
closedir(subdir);
}
else if (exists)
continue;
else if (S_ISLNK(st_template.st_mode)) {
struct strbuf lnk = STRBUF_INIT;
- if (strbuf_readlink(&lnk, template->buf, 0) < 0)
- die_errno(_("cannot readlink '%s'"), template->buf);
+ if (strbuf_readlink(&lnk, template
_path
->buf, 0) < 0)
+ die_errno(_("cannot readlink '%s'"), template
_path
->buf);
if (symlink(lnk.buf, path->buf))
die_errno(_("cannot symlink '%s' '%s'"),
lnk.buf, path->buf);
strbuf_release(&lnk);
}
else if (S_ISREG(st_template.st_mode)) {
if (symlink(lnk.buf, path->buf))
die_errno(_("cannot symlink '%s' '%s'"),
lnk.buf, path->buf);
strbuf_release(&lnk);
}
else if (S_ISREG(st_template.st_mode)) {
- if (copy_file(path->buf, template->buf, st_template.st_mode))
+ if (copy_file(path->buf, template
_path
->buf, st_template.st_mode))
die_errno(_("cannot copy '%s' to '%s'"),
die_errno(_("cannot copy '%s' to '%s'"),
- template->buf, path->buf);
+ template
_path
->buf, path->buf);
}
else
}
else
- error(_("ignoring template %s"), template->buf);
+ error(_("ignoring template %s"), template
_path
->buf);
}
}
}
}