3 test_description
='Test git update-server-info'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'setup' 'test_commit file'
10 test_expect_success
'create info/refs' '
11 git update-server-info &&
12 test_path_is_file .git/info/refs
15 test_expect_success
'modify and store mtime' '
16 test-tool chmtime =0 .git/info/refs &&
17 test-tool chmtime --get .git/info/refs >a
20 test_expect_success
'info/refs is not needlessly overwritten' '
21 git update-server-info &&
22 test-tool chmtime --get .git/info/refs >b &&
26 test_expect_success
'info/refs can be forced to update' '
27 git update-server-info -f &&
28 test-tool chmtime --get .git/info/refs >b &&
32 test_expect_success
'info/refs updates when changes are made' '
33 test-tool chmtime =0 .git/info/refs &&
34 test-tool chmtime --get .git/info/refs >b &&
36 git update-ref refs/heads/foo HEAD &&
37 git update-server-info &&
38 test-tool chmtime --get .git/info/refs >b &&
42 test_expect_success
'midx does not create duplicate pack entries' '
43 git repack -d --write-midx &&
45 grep ^P .git/objects/info/packs >packs &&
46 uniq -d <packs >dups &&
47 test_must_be_empty dups