1
1
#ifndef ENVIRONMENT_H
2
2
#define ENVIRONMENT_H
3
3
4
- struct strvec ;
5
-
6
- /*
7
- * The character that begins a commented line in user-editable file
8
- * that is subject to stripspace.
9
- */
10
- extern const char * comment_line_str ;
11
- extern char * comment_line_str_to_free ;
12
- extern int auto_comment_line_char ;
13
-
14
- /*
15
- * Wrapper of getenv() that returns a strdup value. This value is kept
16
- * in argv to be freed later.
17
- */
18
- const char * getenv_safe (struct strvec * argv , const char * name );
19
-
20
4
/* Double-check local_repo_env below if you add to this list. */
21
5
#define GIT_DIR_ENVIRONMENT "GIT_DIR"
22
6
#define GIT_COMMON_DIR_ENVIRONMENT "GIT_COMMON_DIR"
@@ -86,6 +70,8 @@ const char *getenv_safe(struct strvec *argv, const char *name);
86
70
*/
87
71
#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE"
88
72
73
+ #define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
74
+
89
75
/*
90
76
* Repository-local GIT_* environment variables; these will be cleared
91
77
* when git spawns a sub-process that runs inside another repository.
@@ -94,6 +80,28 @@ const char *getenv_safe(struct strvec *argv, const char *name);
94
80
*/
95
81
extern const char * const local_repo_env [];
96
82
83
+ struct strvec ;
84
+
85
+ /*
86
+ * Wrapper of getenv() that returns a strdup value. This value is kept
87
+ * in argv to be freed later.
88
+ */
89
+ const char * getenv_safe (struct strvec * argv , const char * name );
90
+
91
+ /*
92
+ * Should we print an ellipsis after an abbreviated SHA-1 value
93
+ * when doing diff-raw output or indicating a detached HEAD?
94
+ */
95
+ int print_sha1_ellipsis (void );
96
+
97
+ /*
98
+ * Returns the boolean value of $GIT_OPTIONAL_LOCKS (or the default value).
99
+ */
100
+ int use_optional_locks (void );
101
+
102
+ const char * get_git_namespace (void );
103
+ const char * strip_namespace (const char * namespaced_ref );
104
+
97
105
void setup_git_env (const char * git_dir );
98
106
99
107
/*
@@ -102,13 +110,19 @@ void setup_git_env(const char *git_dir);
102
110
*/
103
111
int have_git_dir (void );
104
112
113
+ /*
114
+ * Accessors for the core.sharedrepository config which lazy-load the value
115
+ * from the config (if not already set). The "reset" function can be
116
+ * used to unset "set" or cached value, meaning that the value will be loaded
117
+ * fresh from the config file on the next call to get_shared_repository().
118
+ */
119
+ void set_shared_repository (int value );
120
+ int get_shared_repository (void );
121
+ void reset_shared_repository (void );
122
+
105
123
extern int is_bare_repository_cfg ;
106
124
int is_bare_repository (void );
107
125
extern char * git_work_tree_cfg ;
108
- const char * get_git_namespace (void );
109
- const char * strip_namespace (const char * namespaced_ref );
110
-
111
- #define ALTERNATE_DB_ENVIRONMENT "GIT_ALTERNATE_OBJECT_DIRECTORIES"
112
126
113
127
/* Environment bits from configuration mechanism */
114
128
extern int trust_executable_bit ;
@@ -134,16 +148,6 @@ extern unsigned long big_file_threshold;
134
148
extern unsigned long pack_size_limit_cfg ;
135
149
extern int max_allowed_tree_depth ;
136
150
137
- /*
138
- * Accessors for the core.sharedrepository config which lazy-load the value
139
- * from the config (if not already set). The "reset" function can be
140
- * used to unset "set" or cached value, meaning that the value will be loaded
141
- * fresh from the config file on the next call to get_shared_repository().
142
- */
143
- void set_shared_repository (int value );
144
- int get_shared_repository (void );
145
- void reset_shared_repository (void );
146
-
147
151
extern int core_preload_index ;
148
152
extern int precomposed_unicode ;
149
153
extern int protect_hfs ;
@@ -153,11 +157,6 @@ extern int core_apply_sparse_checkout;
153
157
extern int core_sparse_checkout_cone ;
154
158
extern int sparse_expect_files_outside_of_patterns ;
155
159
156
- /*
157
- * Returns the boolean value of $GIT_OPTIONAL_LOCKS (or the default value).
158
- */
159
- int use_optional_locks (void );
160
-
161
160
enum log_refs_config {
162
161
LOG_REFS_UNSET = -1 ,
163
162
LOG_REFS_NONE = 0 ,
@@ -172,6 +171,7 @@ enum rebase_setup_type {
172
171
AUTOREBASE_REMOTE ,
173
172
AUTOREBASE_ALWAYS
174
173
};
174
+ extern enum rebase_setup_type autorebase ;
175
175
176
176
enum push_default_type {
177
177
PUSH_DEFAULT_NOTHING = 0 ,
@@ -181,15 +181,12 @@ enum push_default_type {
181
181
PUSH_DEFAULT_CURRENT ,
182
182
PUSH_DEFAULT_UNSPECIFIED
183
183
};
184
-
185
- extern enum rebase_setup_type autorebase ;
186
184
extern enum push_default_type push_default ;
187
185
188
186
enum object_creation_mode {
189
187
OBJECT_CREATION_USES_HARDLINKS = 0 ,
190
188
OBJECT_CREATION_USES_RENAMES = 1
191
189
};
192
-
193
190
extern enum object_creation_mode object_creation_mode ;
194
191
195
192
extern char * notes_ref_name ;
@@ -209,9 +206,11 @@ extern char *askpass_program;
209
206
extern char * excludes_file ;
210
207
211
208
/*
212
- * Should we print an ellipsis after an abbreviated SHA-1 value
213
- * when doing diff-raw output or indicating a detached HEAD?
209
+ * The character that begins a commented line in user-editable file
210
+ * that is subject to stripspace.
214
211
*/
215
- int print_sha1_ellipsis (void );
212
+ extern const char * comment_line_str ;
213
+ extern char * comment_line_str_to_free ;
214
+ extern int auto_comment_line_char ;
216
215
217
216
#endif
0 commit comments