Add test for the default merges in fetch.
[jc: with minor fix-ups] Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Santi Béjar committed
Sep 23, 2006 at 22:55 UTC
6cc7c36d5e2fd89be596a164bcc2afede9d855d3
1 file changed
+25
t/t5510-fetch.sh
+25
@@ -27,6 +27,16 @@ test_expect_success "clone and setup child repos" '
27
echo "URL: ../one/.git/"
28
echo "Pull: refs/heads/master:refs/heads/one"
29
} >.git/remotes/one
30
+ cd .. &&
31
+ git clone . three &&
32
+ cd three &&
33
+ git repo-config branch.master.remote two &&
34
+ git repo-config branch.master.merge refs/heads/one &&
35
+ {
36
+ echo "URL: ../two/.git/"
37
+ echo "Pull: refs/heads/master:refs/heads/two"
38
+ echo "Pull: refs/heads/one:refs/heads/one"
39
+ } >.git/remotes/two
40
'
41
42
test_expect_success "fetch test" '
@@ -41,4 +51,19 @@ test_expect_success "fetch test" '
51
test "z$mine" = "z$his"
52
'
53
54
+test_expect_success "fetch test for-merge" '
55
+ cd "$D" &&
56
+ cd three &&
57
+ git fetch &&
58
+ test -f .git/refs/heads/two &&
59
+ test -f .git/refs/heads/one &&
60
+ master_in_two=`cd ../two && git rev-parse master` &&
61
+ one_in_two=`cd ../two && git rev-parse one` &&
62
+ {
63
+ echo "$master_in_two not-for-merge"
64
+ echo "$one_in_two "
65
+ } >expected &&
66
+ cut -f -2 .git/FETCH_HEAD >actual &&
67
+ diff expected actual'
68
+
69
test_done