diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-04-11 10:46:32 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-04-11 10:46:32 +0900 |
| commit | 2d5792f0716605ff0059fe4b5c865d6821c0161e (patch) | |
| tree | f54d21723cf1216001ec9643f91f0d60136a8643 /environment.c | |
| parent | 7547b95b4fbb8591726b1d9381c176cc27fc6aea (diff) | |
| parent | efdfe11f4f1f901db1ebfa7ebda6337293a2e5c5 (diff) | |
| download | git-2d5792f0716605ff0059fe4b5c865d6821c0161e.tar.gz | |
Merge branch 'bw/c-plus-plus' into ds/lazy-load-trees
* 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.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/environment.c b/environment.c index 0e96be30ca..8853e2f0dd 100644 --- a/environment.c +++ b/environment.c @@ -101,7 +101,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; @@ -159,8 +159,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); @@ -194,9 +194,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) @@ -250,7 +250,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; /* @@ -258,16 +258,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) |
