summaryrefslogtreecommitdiff
path: root/t/t9500-gitweb-standalone-no-errors.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-07-29 23:14:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-30 16:16:48 (GMT)
commit6ff6a6759de3b85b591f334e13b63456804be328 (patch)
tree052fd974c8d98a9cb21df30ccde7ce99e91e9383 /t/t9500-gitweb-standalone-no-errors.sh
parent831279d3c18694e69a594767b7cc6a88af987cde (diff)
downloadgit-6ff6a6759de3b85b591f334e13b63456804be328.zip
git-6ff6a6759de3b85b591f334e13b63456804be328.tar.gz
git-6ff6a6759de3b85b591f334e13b63456804be328.tar.bz2
t9500: ensure that algorithm info is preserved in config
When we use a hash algorithm other than SHA-1, it's important to preserve the hash-related values in the config file, but this test overwrites the config file with a new one. Ensure we copy these values properly from the old config to the new one so that the repository can be read if it's using SHA-256. Note that if there is no extensions.objectFormat value set, git config will return unsuccessfully if we try to read it; since this is not an error for us, use test_might_fail. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9500-gitweb-standalone-no-errors.sh')
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 267ddc9..b484e3e 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -621,12 +621,22 @@ test_expect_success \
git config gitweb.snapshot "zip,tgz, tbz2" &&
gitweb_run "p=.git;a=tree"'
-cat >.git/config <<\EOF
-# testing noval and alternate separator
-[gitweb]
- blame
- snapshot = zip tgz
-EOF
+test_expect_success 'setup' '
+ version=$(git config core.repositoryformatversion) &&
+ algo=$(test_might_fail git config extensions.objectformat) &&
+ cat >.git/config <<-\EOF &&
+ # testing noval and alternate separator
+ [gitweb]
+ blame
+ snapshot = zip tgz
+ EOF
+ git config core.repositoryformatversion "$version" &&
+ if test -n "$algo"
+ then
+ git config extensions.objectformat "$algo"
+ fi
+'
+
test_expect_success \
'config override: tree view, features enabled in repo config (2)' \
'gitweb_run "p=.git;a=tree"'