1
0
mirror of https://github.com/git/git.git synced 2024-09-29 06:11:51 +02:00
git/t/t5510-fetch.sh
Junio C Hamano 7be1d62c6f Add t5510 to test per branch configuration affecting git-fetch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-24 00:13:49 -07:00

45 lines
894 B
Bash
Executable File

#!/bin/sh
# Copyright (c) 2006, Junio C Hamano.
test_description='Per branch config variables affects "git fetch".
'
. ./test-lib.sh
D=`pwd`
test_expect_success setup '
echo >file original &&
git add file &&
git commit -a -m original'
test_expect_success "clone and setup child repos" '
git clone . one &&
cd one &&
echo >file updated by one &&
git commit -a -m "updated by one" &&
cd .. &&
git clone . two &&
cd two &&
git repo-config branch.master.remote one &&
{
echo "URL: ../one/.git/"
echo "Pull: refs/heads/master:refs/heads/one"
} >.git/remotes/one
'
test_expect_success "fetch test" '
cd "$D" &&
echo >file updated by origin &&
git commit -a -m "updated by origin" &&
cd two &&
git fetch &&
test -f .git/refs/heads/one &&
mine=`git rev-parse refs/heads/one` &&
his=`cd ../one && git rev-parse refs/heads/master` &&
test "z$mine" = "z$his"
'
test_done