зеркало из https://github.com/microsoft/git.git
t5510: add a bit more tests for fetch
"git pull/fetch" that gets explicit refspecs from the command line should not update configured tracking refs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
ab7d707669
Коммит
c701596199
|
@ -253,4 +253,46 @@ test_expect_success 'bundle should record HEAD correctly' '
|
|||
|
||||
'
|
||||
|
||||
test_expect_success 'explicit fetch should not update tracking' '
|
||||
|
||||
cd "$D" &&
|
||||
git branch -f side &&
|
||||
(
|
||||
cd three &&
|
||||
o=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
git fetch origin master &&
|
||||
n=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
test "$o" = "$n" &&
|
||||
! git rev-parse --verify refs/remotes/origin/side
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'explicit pull should not update tracking' '
|
||||
|
||||
cd "$D" &&
|
||||
git branch -f side &&
|
||||
(
|
||||
cd three &&
|
||||
o=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
git pull origin master &&
|
||||
n=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
test "$o" = "$n" &&
|
||||
! git rev-parse --verify refs/remotes/origin/side
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'configured fetch updates tracking' '
|
||||
|
||||
cd "$D" &&
|
||||
git branch -f side &&
|
||||
(
|
||||
cd three &&
|
||||
o=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
git fetch origin &&
|
||||
n=$(git rev-parse --verify refs/remotes/origin/master) &&
|
||||
test "$o" != "$n" &&
|
||||
git rev-parse --verify refs/remotes/origin/side
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Загрузка…
Ссылка в новой задаче