interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t5200-update-server-info.sh

54 lines · 1349 bytes Raw Blame History
1#!/bin/sh
2
3test_description='Test git update-server-info'
4
5. ./test-lib.sh
6
7test_expect_success 'setup' 'test_commit file'
8
9test_expect_success 'create info/refs' '
10 git update-server-info &&
11 test_path_is_file .git/info/refs
12'
13
14test_expect_success 'modify and store mtime' '
15 test-tool chmtime =0 .git/info/refs &&
16 test-tool chmtime --get .git/info/refs >a
17'
18
19test_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
23'
24
25test_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
29'
30
31test_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
39'
40
41test_expect_success 'midx does not create duplicate pack entries' '
42 git repack -d --write-midx &&
43 git repack -d &&
44 grep ^P .git/objects/info/packs >packs &&
45 uniq -d <packs >dups &&
46 test_must_be_empty dups
47'
48
49test_expect_success 'update-server-info does not crash with -h' '
50 git update-server-info -h >usage &&
51 test_grep "[Uu]sage: git update-server-info " usage
52'
53
54test_done