init: correct re-initialization from a linked worktree
[gitweb.git] / config.c
index 6dbc8a409e7e6e674e399e1d9b8ef8ef3c9290b7..5e50fb1a31a5b4e0bb3c4cf517023c447c2f925f 100644 (file)
--- a/config.c
+++ b/config.c
@@ -836,9 +836,6 @@ static int git_default_core_config(const char *var, const char *value)
                return 0;
        }
 
-       if (!strcmp(var, "core.pager"))
-               return git_config_string(&pager_program, var, value);
-
        if (!strcmp(var, "core.editor"))
                return git_config_string(&editor_program, var, value);
 
@@ -1197,7 +1194,7 @@ static int do_git_config_sequence(config_fn_t fn, void *data)
        int ret = 0, found = 0;
        char *xdg_config = xdg_config_home("config");
        char *user_config = expand_user_path("~/.gitconfig");
-       char *repo_config = git_pathdup("config");
+       char *repo_config = have_git_dir() ? git_pathdup("config") : NULL;
 
        if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0)) {
                ret += git_config_from_file(fn, git_etc_gitconfig(),