test: remove httpd tests that ask for user
[git] / t / t5513-fetch-track.sh
1 #!/bin/sh
2
3 test_description='fetch follows remote-tracking branches correctly'
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8         >file &&
9         git add . &&
10         test_tick &&
11         git commit -m Initial &&
12         git branch b-0 &&
13         git branch b1 &&
14         git branch b/one &&
15         test_create_repo other &&
16         (
17                 cd other &&
18                 git config remote.origin.url .. &&
19                 git config remote.origin.fetch "+refs/heads/b/*:refs/remotes/b/*"
20         )
21 '
22
23 test_expect_success fetch '
24         (
25                 cd other && git fetch origin &&
26                 test "$(git for-each-ref --format="%(refname)")" = refs/remotes/b/one
27         )
28 '
29
30 cat >expected <<EOF
31 236e830928a4295f5473416501dd777933bb778e                branch 'master' of .
32 EOF
33
34 test_expect_success 'fetch default' '
35         test_when_finished "rm -rf another" &&
36
37         (
38                 test_create_repo another &&
39                 cd another &&
40                 git remote add origin .. &&
41                 echo test > file &&
42                 git add . &&
43                 git commit -m test &&
44                 git checkout -t -b local-tracking master &&
45                 git fetch &&
46                 test_cmp ../expected .git/FETCH_HEAD
47         )
48 '
49 cat >expected <<EOF
50 9d34b142e42f6b3dbab46dd4b9bc515e0ab16101        not-for-merge   branch 'b-0' of ..
51 9d34b142e42f6b3dbab46dd4b9bc515e0ab16101        not-for-merge   branch 'b/one' of ..
52 9d34b142e42f6b3dbab46dd4b9bc515e0ab16101        not-for-merge   branch 'b1' of ..
53 9d34b142e42f6b3dbab46dd4b9bc515e0ab16101        not-for-merge   branch 'master' of ..
54 EOF
55
56 test_expect_success 'fetch default simple' '
57         test_when_finished "rm -rf another" &&
58
59         (
60                 test_create_repo another &&
61                 cd another &&
62                 git config fetch.default simple &&
63                 git remote add origin .. &&
64                 echo test > file &&
65                 git add . &&
66                 git commit -m test &&
67                 git checkout -t -b local-tracking master &&
68                 git fetch &&
69                 test_cmp ../expected .git/FETCH_HEAD
70         )
71 '
72
73 test_done