author | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Jan 2010 22:56:25 +0000 (14:56 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Jan 2010 22:56:25 +0000 (14:56 -0800) |
* jh/maint-config-file-prefix:
builtin-config: Fix crash when using "-f <relative path>" from non-root dir
builtin-config: Fix crash when using "-f <relative path>" from non-root dir
builtin-config.c | patch | blob | history | |
t/t1300-repo-config.sh | patch | blob | history |
diff --git a/builtin-config.c b/builtin-config.c
index 2e3ef911d6d6682bc2f71ea912b05768fb6298be..4bc46b15fde00d913577a2980778746f8315bb70 100644 (file)
--- a/builtin-config.c
+++ b/builtin-config.c
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 f89d7e9e4959ddccafafd11c5fbf9f4b06541578..f11f98c3ce7e35f61d06542ce707d61b98079fda 100755 (executable)
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
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