summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:07 (GMT)
commit169c9c0169a00876f699678ac66ebe9563b0c29f (patch)
tree5344fd15a9134aa92eaf79ff5959f616cceffa17 /environment.c
parentc14d5f99cd91347db3978c58c4b24d60ca29af75 (diff)
parentefdfe11f4f1f901db1ebfa7ebda6337293a2e5c5 (diff)
downloadgit-169c9c0169a00876f699678ac66ebe9563b0c29f.zip
git-169c9c0169a00876f699678ac66ebe9563b0c29f.tar.gz
git-169c9c0169a00876f699678ac66ebe9563b0c29f.tar.bz2
Merge branch 'bw/c-plus-plus'
Avoid using identifiers that clash with C++ keywords. Even though it is not a goal to compile Git with C++ compilers, changes like this help use of code analysis tools that targets C++ on our codebase. * bw/c-plus-plus: (37 commits) replace: rename 'new' variables trailer: rename 'template' variables tempfile: rename 'template' variables wrapper: rename 'template' variables environment: rename 'namespace' variables diff: rename 'template' variables environment: rename 'template' variables init-db: rename 'template' variables unpack-trees: rename 'new' variables trailer: rename 'new' variables submodule: rename 'new' variables split-index: rename 'new' variables remote: rename 'new' variables ref-filter: rename 'new' variables read-cache: rename 'new' variables line-log: rename 'new' variables imap-send: rename 'new' variables http: rename 'new' variables entry: rename 'new' variables diffcore-delta: rename 'new' variables ...
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/environment.c b/environment.c
index de8431e..d6dd646 100644
--- a/environment.c
+++ b/environment.c
@@ -100,7 +100,7 @@ int ignore_untracked_cache_config;
/* This is set by setup_git_dir_gently() and/or git_default_config() */
char *git_work_tree_cfg;
-static char *namespace;
+static char *git_namespace;
static const char *super_prefix;
@@ -158,8 +158,8 @@ void setup_git_env(void)
free(git_replace_ref_base);
git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base
: "refs/replace/");
- free(namespace);
- namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT));
+ free(git_namespace);
+ git_namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT));
shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT);
if (shallow_file)
set_alternate_shallow_file(shallow_file, 0);
@@ -193,9 +193,9 @@ const char *get_git_common_dir(void)
const char *get_git_namespace(void)
{
- if (!namespace)
+ if (!git_namespace)
BUG("git environment hasn't been setup");
- return namespace;
+ return git_namespace;
}
const char *strip_namespace(const char *namespaced_ref)
@@ -249,7 +249,7 @@ char *get_object_directory(void)
return the_repository->objectdir;
}
-int odb_mkstemp(struct strbuf *template, const char *pattern)
+int odb_mkstemp(struct strbuf *temp_filename, const char *pattern)
{
int fd;
/*
@@ -257,16 +257,16 @@ int odb_mkstemp(struct strbuf *template, const char *pattern)
* restrictive except to remove write permission.
*/
int mode = 0444;
- git_path_buf(template, "objects/%s", pattern);
- fd = git_mkstemp_mode(template->buf, mode);
+ git_path_buf(temp_filename, "objects/%s", pattern);
+ fd = git_mkstemp_mode(temp_filename->buf, mode);
if (0 <= fd)
return fd;
/* slow path */
- /* some mkstemp implementations erase template on failure */
- git_path_buf(template, "objects/%s", pattern);
- safe_create_leading_directories(template->buf);
- return xmkstemp_mode(template->buf, mode);
+ /* some mkstemp implementations erase temp_filename on failure */
+ git_path_buf(temp_filename, "objects/%s", pattern);
+ safe_create_leading_directories(temp_filename->buf);
+ return xmkstemp_mode(temp_filename->buf, mode);
}
int odb_pack_keep(const char *name)