Skip to content

Commit 9967f9f

Browse files
committed
squash! Merge pull request #104 from dscho/super-config
Back out the super-config branch in favor of the program-data-config branch (which is a better version of the same feature). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 59bd1a9 commit 9967f9f

File tree

5 files changed

+1
-34
lines changed

5 files changed

+1
-34
lines changed

Documentation/config.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ the Git commands' behavior. The `.git/config` file in each repository
66
is used to store the configuration for that repository, and
77
`$HOME/.gitconfig` is used to store a per-user configuration as
88
fallback values for the `.git/config` file. The file `/etc/gitconfig`
9-
can be used to store a system-wide default configuration. On Windows,
10-
configuration can also be stored in `C:\ProgramData\Git\config`; This
11-
file will be used also by libgit2-based software.
9+
can be used to store a system-wide default configuration.
1210

1311
The configuration variables are used by both the Git plumbing
1412
and the porcelains. The variables are divided into sections, wherein

compat/mingw.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "../git-compat-util.h"
22
#include "win32.h"
33
#include <conio.h>
4-
#include <shlobj.h>
54
#include <wchar.h>
65
#include <winioctl.h>
76
#include "../strbuf.h"
@@ -2655,20 +2654,3 @@ void mingw_startup()
26552654
/* init length of current directory for handle_long_path */
26562655
current_directory_len = GetCurrentDirectoryW(0, NULL);
26572656
}
2658-
2659-
const char *windows_wide_config(void)
2660-
{
2661-
static struct strbuf windows_wide = STRBUF_INIT;
2662-
if (!windows_wide.len) {
2663-
wchar_t wbuffer[MAX_PATH];
2664-
if (SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL,
2665-
SHGFP_TYPE_CURRENT, wbuffer) != S_OK)
2666-
strbuf_addch(&windows_wide, '\0');
2667-
else {
2668-
char buffer[MAX_PATH];
2669-
xwcstoutf(buffer, wbuffer, sizeof(buffer));
2670-
strbuf_addf(&windows_wide, "%s\\Git\\config", buffer);
2671-
}
2672-
}
2673-
return *windows_wide.buf ? windows_wide.buf : NULL;
2674-
}

compat/mingw.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ static inline char *mingw_find_last_dir_sep(const char *path)
390390
int mingw_offset_1st_component(const char *path);
391391
#define offset_1st_component mingw_offset_1st_component
392392
#define PATH_SEP ';'
393-
extern const char *windows_wide_config(void);
394-
#define git_super_config windows_wide_config
395393
#ifndef __MINGW64_VERSION_MAJOR
396394
#define PRIuMAX "I64u"
397395
#define PRId64 "I64d"

config.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,18 +1204,11 @@ int git_config_system(void)
12041204
int git_config_early(config_fn_t fn, void *data, const char *repo_config)
12051205
{
12061206
int ret = 0, found = 0;
1207-
const char *super_config = git_super_config();
12081207
char *xdg_config = NULL;
12091208
char *user_config = NULL;
12101209

12111210
home_config_paths(&user_config, &xdg_config, "config");
12121211

1213-
if (super_config && git_config_system() &&
1214-
!access(super_config, R_OK)) {
1215-
ret += git_config_from_file(fn, super_config, data);
1216-
found += 1;
1217-
}
1218-
12191212
if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0)) {
12201213
ret += git_config_from_file(fn, git_etc_gitconfig(),
12211214
data);

git-compat-util.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,6 @@ static inline char *git_find_last_dir_sep(const char *path)
310310
#define find_last_dir_sep git_find_last_dir_sep
311311
#endif
312312

313-
#ifndef git_super_config
314-
#define git_super_config() NULL
315-
#endif
316-
317313
#if defined(__HP_cc) && (__HP_cc >= 61000)
318314
#define NORETURN __attribute__((noreturn))
319315
#define NORETURN_PTR

0 commit comments

Comments
 (0)