diff options
| author | Junio C Hamano <gitster@pobox.com> | 2010-02-10 13:02:05 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2010-02-10 13:02:05 -0800 |
| commit | b0e67fffb42059cc5dca6f58c376a2ffc5fb4520 (patch) | |
| tree | 4008cbd4d131ffc0fc8105161f593a35f7a7691d | |
| parent | Merge branch 'nd/include-termios-for-osol' into maint (diff) | |
| parent | builtin-config: Fix crash when using "-f <relative path>" from non-root dir (diff) | |
| download | git-b0e67fffb42059cc5dca6f58c376a2ffc5fb4520.tar.gz git-b0e67fffb42059cc5dca6f58c376a2ffc5fb4520.zip | |
Merge branch 'jh/maint-config-file-prefix' into maint
* jh/maint-config-file-prefix:
builtin-config: Fix crash when using "-f <relative path>" from non-root dir
| -rw-r--r-- | builtin-config.c | 2 | ||||
| -rwxr-xr-x | t/t1300-repo-config.sh | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/builtin-config.c b/builtin-config.c index a2d656edb3..78724fbf7d 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -340,7 +340,7 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix) if (!is_absolute_path(given_config_file) && prefix) config_exclusive_filename = prefix_filename(prefix, strlen(prefix), - argv[2]); + given_config_file); else config_exclusive_filename = given_config_file; } diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 83b7294010..9e74b1f141 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -398,6 +398,17 @@ test_expect_success 'alternative GIT_CONFIG' 'cmp output expect' test_expect_success 'alternative GIT_CONFIG (--file)' \ 'git config --file other-config -l > output && cmp output expect' +test_expect_success 'refer config from subdirectory' ' + mkdir x && + ( + cd x && + echo strasse >expect + git config --get --file ../other-config ein.bahn >actual && + test_cmp expect actual + ) + +' + GIT_CONFIG=other-config git config anwohner.park ausweis cat > expect << EOF |
