{"thread":{"id":"19737","subject":"[PATCHv3 3/4] t5520-pull: --rebase with rebased upstream and two branches","startedAt":"2009-06-08T09:00:50Z","lastAt":"2009-06-08T09:00:50Z","messageCount":1,"participants":["Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"115783","messageId":"1244451651-22651-4-git-send-email-santi@agolina.net","threadId":"19737","inReplyTo":null,"subject":"[PATCHv3 3/4] t5520-pull: --rebase with rebased upstream and two branches","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-06-08T09:00:50Z","receivedAt":"2009-06-08T09:00:50Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"If you have two branches tracking an upstream that is rebased,\ncurrently you have to do:\n\ngit checkout branch1\ngit pull --rebase remote branch\ngit checkout branch2\ngit pull --rebase remote branch\n\nThe second rebase works because the first \"git pull --rebase\" does not\nstore in the local tracking branch the new value, so the second rebase\ndetects that it is rebased.\n\nOne should be able to do the same without the explicit\narguments to \"git pull --rebase\", but without arguments it stores the\nnew state of the remote branch so the second \"git pull --rebase\" does\nnot work.\n\nMark this case as test_expect_failure to make people aware of this\nbehavior.\n\nSigned-off-by: Santi Béjar <santi@agolina.net>\n---\nHi,\n\nI just wanted to make people aware of this behavior and then decide if\nthis is the correct behavior, so document it, or try to find a better\nsolution.\n\nSanti\n t/t5520-pull.sh |   15 +++++++++++++++\n 1 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex c5a2e66..164a0eb 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -117,8 +117,23 @@ test_expect_success '--rebase with rebased default upstream' '\n \n '\n \n+test_expect_failure '--rebase with rebased upstream and two branches' '\n+\n+\tgit update-ref refs/remotes/me/copy copy-orig &&\n+\tgit reset --hard to-rebase-orig &&\n+\tgit checkout --track -b to-rebase3 me/copy &&\n+\tgit reset --hard to-rebase-orig &&\n+\tgit pull --rebase &&\n+\ttest \"conflicting modification\" = \"$(cat file)\" &&\n+\ttest file = $(cat file2) &&\n+\tgit checkout to-rebase2 &&\n+\tgit pull --rebase\n+\n+'\n+\n test_expect_success 'pull --rebase dies early with dirty working directory' '\n \n+\tgit rebase --abort &&\n \tgit checkout to-rebase &&\n \tgit update-ref refs/remotes/me/copy copy^ &&\n \tCOPY=$(git rev-parse --verify me/copy) &&\n-- \n1.6.3.1.308.g426b5\n"}]}