Skip to content

Commit 6ff6a67

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831279d commit 6ff6a67

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,22 @@ test_expect_success \
621621
git config gitweb.snapshot "zip,tgz, tbz2" &&
622622
gitweb_run "p=.git;a=tree"'
623623

624-
cat >.git/config <<\EOF
625-
# testing noval and alternate separator
626-
[gitweb]
627-
blame
628-
snapshot = zip tgz
629-
EOF
624+
test_expect_success 'setup' '
625+
version=$(git config core.repositoryformatversion) &&
626+
algo=$(test_might_fail git config extensions.objectformat) &&
627+
cat >.git/config <<-\EOF &&
628+
# testing noval and alternate separator
629+
[gitweb]
630+
blame
631+
snapshot = zip tgz
632+
EOF
633+
git config core.repositoryformatversion "$version" &&
634+
if test -n "$algo"
635+
then
636+
git config extensions.objectformat "$algo"
637+
fi
638+
'
639+
630640
test_expect_success \
631641
'config override: tree view, features enabled in repo config (2)' \
632642
'gitweb_run "p=.git;a=tree"'

0 commit comments

Comments
 (0)