t/t4*: merge a "grep | sed" pipeline
[git.git] / t / t5200-update-server-info.sh
blobed9dfd624c754206e58b7eaaf0c023b573d8ffc1
1 #!/bin/sh
3 test_description='Test git update-server-info'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
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 &&
23 test_cmp a 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 &&
29 ! test_cmp a 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 &&
35 test_cmp a b &&
36 git update-ref refs/heads/foo HEAD &&
37 git update-server-info &&
38 test-tool chmtime --get .git/info/refs >b &&
39 ! test_cmp a b
42 test_done