Merge branch 'am/visual-studio-config-fix'
[git/debian.git] / t / t5200-update-server-info.sh
blob21a58eecb9b59a344e81f222b322a8ffe080e22e
1 #!/bin/sh
3 test_description='Test git update-server-info'
5 . ./test-lib.sh
7 test_expect_success 'setup' 'test_commit file'
9 test_expect_success 'create info/refs' '
10 git update-server-info &&
11 test_path_is_file .git/info/refs
14 test_expect_success 'modify and store mtime' '
15 test-tool chmtime =0 .git/info/refs &&
16 test-tool chmtime --get .git/info/refs >a
19 test_expect_success 'info/refs is not needlessly overwritten' '
20 git update-server-info &&
21 test-tool chmtime --get .git/info/refs >b &&
22 test_cmp a b
25 test_expect_success 'info/refs can be forced to update' '
26 git update-server-info -f &&
27 test-tool chmtime --get .git/info/refs >b &&
28 ! test_cmp a b
31 test_expect_success 'info/refs updates when changes are made' '
32 test-tool chmtime =0 .git/info/refs &&
33 test-tool chmtime --get .git/info/refs >b &&
34 test_cmp a b &&
35 git update-ref refs/heads/foo HEAD &&
36 git update-server-info &&
37 test-tool chmtime --get .git/info/refs >b &&
38 ! test_cmp a b
41 test_done