Changeset 782 for git/branches/dmik/environment.c
- Timestamp:
- Jun 23, 2014, 9:45:51 PM (11 years ago)
- Location:
- git/branches/dmik
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
git/branches/dmik ¶
- Property svn:mergeinfo changed
/git/vendor/2.0.0 (added) merged: 777 /git/vendor/current merged: 772,774,776
- Property svn:mergeinfo changed
-
TabularUnified git/branches/dmik/environment.c ¶
r626 r782 11 11 #include "refs.h" 12 12 #include "fmt-merge-msg.h" 13 14 char git_default_email[MAX_GITNAME]; 15 char git_default_name[MAX_GITNAME]; 16 int user_ident_explicitly_given; 13 #include "commit.h" 14 17 15 int trust_executable_bit = 1; 18 16 int trust_ctime = 1; 17 int check_stat = 1; 19 18 int has_symlinks = 1; 20 19 int minimum_abbrev = 4, default_abbrev = 7; … … 25 24 int log_all_ref_updates = -1; /* unspecified */ 26 25 int warn_ambiguous_refs = 1; 26 int warn_on_object_refname_ambiguity = 1; 27 27 int repository_format_version; 28 28 const char *git_commit_encoding; … … 40 40 size_t delta_base_cache_limit = 16 * 1024 * 1024; 41 41 unsigned long big_file_threshold = 512 * 1024 * 1024; 42 const char *log_pack_access;43 42 const char *pager_program; 44 43 int pager_use_color = 1; … … 47 46 const char *excludes_file; 48 47 enum auto_crlf auto_crlf = AUTO_CRLF_FALSE; 49 int read_replace_refs = 1; /* NEEDSWORK: rename to use_replace_refs */48 int check_replace_refs = 1; 50 49 enum eol core_eol = EOL_UNSET; 51 50 enum safe_crlf safe_crlf = SAFE_CRLF_WARN; … … 53 52 enum branch_track git_branch_track = BRANCH_TRACK_REMOTE; 54 53 enum rebase_setup_type autorebase = AUTOREBASE_NEVER; 55 enum push_default_type push_default = PUSH_DEFAULT_ MATCHING;54 enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED; 56 55 #ifndef OBJECT_CREATION_MODE 57 56 #define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS … … 62 61 int core_apply_sparse_checkout; 63 62 int merge_log_config = -1; 63 int precomposed_unicode = -1; /* see probe_utf8_pathname_composition() */ 64 64 struct startup_info *startup_info; 65 65 unsigned long pack_size_limit_cfg; 66 67 /* 68 * The character that begins a commented line in user-editable file 69 * that is subject to stripspace. 70 */ 71 char comment_line_char = '#'; 66 72 67 73 /* Parallel index stat data preload? */ … … 79 85 80 86 /* 81 * Repository-local GIT_* environment variables 82 * Remember to update local_repo_env_size in cache.h when 83 * the size of the list changes 84 */ 85 const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = { 87 * Repository-local GIT_* environment variables; see cache.h for details. 88 */ 89 const char * const local_repo_env[] = { 86 90 ALTERNATE_DB_ENVIRONMENT, 87 91 CONFIG_ENVIRONMENT, … … 90 94 GIT_DIR_ENVIRONMENT, 91 95 GIT_WORK_TREE_ENVIRONMENT, 96 GIT_IMPLICIT_WORK_TREE_ENVIRONMENT, 92 97 GRAFT_ENVIRONMENT, 93 98 INDEX_ENVIRONMENT, 94 99 NO_REPLACE_OBJECTS_ENVIRONMENT, 100 GIT_PREFIX_ENVIRONMENT, 101 GIT_SHALLOW_FILE_ENVIRONMENT, 95 102 NULL 96 103 }; … … 119 126 static void setup_git_env(void) 120 127 { 128 const char *gitfile; 129 const char *shallow_file; 130 121 131 git_dir = getenv(GIT_DIR_ENVIRONMENT); 122 git_dir = git_dir ? xstrdup(git_dir) : NULL;123 if (!git_dir) {124 git_dir = read_gitfile(DEFAULT_GIT_DIR_ENVIRONMENT);125 git_dir = git_dir ? xstrdup(git_dir) : NULL;126 }127 132 if (!git_dir) 128 133 git_dir = DEFAULT_GIT_DIR_ENVIRONMENT; 134 gitfile = read_gitfile(git_dir); 135 git_dir = xstrdup(gitfile ? gitfile : git_dir); 129 136 git_object_dir = getenv(DB_ENVIRONMENT); 130 137 if (!git_object_dir) { … … 141 148 git_graft_file = git_pathdup("info/grafts"); 142 149 if (getenv(NO_REPLACE_OBJECTS_ENVIRONMENT)) 143 read_replace_refs = 0;150 check_replace_refs = 0; 144 151 namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT)); 145 152 namespace_len = strlen(namespace); 153 shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT); 154 if (shallow_file) 155 set_alternate_shallow_file(shallow_file, 0); 146 156 } 147 157 … … 152 162 } 153 163 154 int have_git_dir(void)155 {156 return !!git_dir;157 }158 159 164 const char *get_git_dir(void) 160 165 { … … 173 178 const char *strip_namespace(const char *namespaced_ref) 174 179 { 175 if ( prefixcmp(namespaced_ref, get_git_namespace()) != 0)180 if (!starts_with(namespaced_ref, get_git_namespace())) 176 181 return NULL; 177 182 return namespaced_ref + namespace_len; … … 233 238 } 234 239 235 int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1)240 int odb_pack_keep(char *name, size_t namesz, const unsigned char *sha1) 236 241 { 237 242 int fd;
Note:
See TracChangeset
for help on using the changeset viewer.