aboutsummaryrefslogtreecommitdiff
path: root/t/t5520-pull.sh
diff options
context:
space:
mode:
authorSanti Béjar <santi@agolina.net>2009-06-12 00:39:19 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-11 19:50:34 -0700
commite9460a66e0d11b718757cd88eb0c927f2b79e1c8 (patch)
tree8f54583f57b9f6ce08b394478eb5f86d11120d04 /t/t5520-pull.sh
parent97af7ff0553ed81bb905dbc0c8b0f9a0c10bfb3d (diff)
downloadgit-e9460a66e0d11b718757cd88eb0c927f2b79e1c8.tar.gz
git-e9460a66e0d11b718757cd88eb0c927f2b79e1c8.tar.xz
parse-remote: support default reflist in get_remote_merge_branch
Expand get_remote_merge_branch to compute the tracking branch to merge when called without arguments (or only the remote name). This allows "git pull --rebase" without arguments (default upstream branch) to work with a rebased upstream. With explicit arguments it already worked. Also add a test to check for this case. Signed-off-by: Santi Béjar <santi@agolina.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 725771fac..c5a2e66a0 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -92,20 +92,34 @@ test_expect_success '--rebase with rebased upstream' '
git remote add -f me . &&
git checkout copy &&
+ git tag copy-orig &&
git reset --hard HEAD^ &&
echo conflicting modification > file &&
git commit -m conflict file &&
git checkout to-rebase &&
echo file > file2 &&
git commit -m to-rebase file2 &&
+ git tag to-rebase-orig &&
git pull --rebase me copy &&
test "conflicting modification" = "$(cat file)" &&
test file = $(cat file2)
'
+test_expect_success '--rebase with rebased default upstream' '
+
+ git update-ref refs/remotes/me/copy copy-orig &&
+ git checkout --track -b to-rebase2 me/copy &&
+ git reset --hard to-rebase-orig &&
+ git pull --rebase &&
+ test "conflicting modification" = "$(cat file)" &&
+ test file = $(cat file2)
+
+'
+
test_expect_success 'pull --rebase dies early with dirty working directory' '
+ git checkout to-rebase &&
git update-ref refs/remotes/me/copy copy^ &&
COPY=$(git rev-parse --verify me/copy) &&
git rebase --onto $COPY copy &&