fetch: get the remote branches to merge from the branch properties
[git/git.git] / t / t5510-fetch.sh
CommitLineData
7be1d62c
JH
1#!/bin/sh
2# Copyright (c) 2006, Junio C Hamano.
3
4test_description='Per branch config variables affects "git fetch".
5
6'
7
8. ./test-lib.sh
9
10D=`pwd`
11
12test_expect_success setup '
13 echo >file original &&
14 git add file &&
15 git commit -a -m original'
16
17test_expect_success "clone and setup child repos" '
18 git clone . one &&
19 cd one &&
20 echo >file updated by one &&
21 git commit -a -m "updated by one" &&
22 cd .. &&
23 git clone . two &&
24 cd two &&
25 git repo-config branch.master.remote one &&
26 {
27 echo "URL: ../one/.git/"
28 echo "Pull: refs/heads/master:refs/heads/one"
29 } >.git/remotes/one
30'
31
32test_expect_success "fetch test" '
33 cd "$D" &&
34 echo >file updated by origin &&
35 git commit -a -m "updated by origin" &&
36 cd two &&
37 git fetch &&
38 test -f .git/refs/heads/one &&
39 mine=`git rev-parse refs/heads/one` &&
40 his=`cd ../one && git rev-parse refs/heads/master` &&
41 test "z$mine" = "z$his"
42'
43
44test_done