{"thread":{"id":"25740","subject":"[PATCH v2] Use reflog in 'pull --rebase . foo'","startedAt":"2010-11-13T22:58:22Z","lastAt":"2010-11-29T23:08:36Z","messageCount":2,"participants":["Martin von Zweigbergk","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"155841","messageId":"1289689102-3507-1-git-send-email-martin.von.zweigbergk@gmail.com","threadId":"25740","inReplyTo":null,"subject":"[PATCH v2] Use reflog in 'pull --rebase . foo'","fromName":"Martin von Zweigbergk","fromEmail":"martin.von.zweigbergk@gmail.com","sentAt":"2010-11-13T22:58:22Z","receivedAt":"2010-11-13T22:58:22Z","isPatch":true,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"Since c85c792 (pull --rebase: be cleverer with rebased upstream\nbranches, 2008-01-26), \"git pull --rebase\" has used the reflog to try to\nrebase from the old upstream onto the new upstream.\n\nMake this work if the local repository is explicitly passed on the\ncommand line as in 'git pull --rebase . foo'.\n\nSigned-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>\nAcked-by: Santi Béjar <santi@agolina.net>\n---\nChanges since v1: Removed some stuff that I should not have included in\nthe first place. (Thanks Santi and Andreas.)\n\n git-parse-remote.sh |   10 ++++++++--\n t/t5520-pull.sh     |    7 +++++++\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 5f47b18..375a0ba 100644\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -89,7 +89,13 @@ get_remote_merge_branch () {\n \t    refs/heads/*) remote=${remote#refs/heads/} ;;\n \t    refs/* | tags/* | remotes/* ) remote=\n \t    esac\n-\n-\t    [ -n \"$remote\" ] && echo \"refs/remotes/$repo/$remote\"\n+\t    [ -n \"$remote\" ] && case \"$repo\" in\n+\t\t.)\n+\t\t    echo \"refs/heads/$remote\"\n+\t\t    ;;\n+\t\t*)\n+\t\t    echo \"refs/remotes/$repo/$remote\"\n+\t\t    ;;\n+\t    esac\n \tesac\n }\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 0b489f5..0470a81 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -222,4 +222,11 @@ test_expect_success 'git pull --rebase does not reapply old patches' '\n \t)\n '\n \n+test_expect_success 'git pull --rebase against local branch' '\n+\tgit checkout -b copy2 to-rebase-orig &&\n+\tgit pull --rebase . to-rebase &&\n+\ttest \"conflicting modification\" = \"$(cat file)\" &&\n+\ttest file = \"$(cat file2)\"\n+'\n+\n test_done\n-- \n1.7.3.2.167.ga361b\n"},{"id":"156860","messageId":"7vaakrzq17.fsf@alter.siamese.dyndns.org","threadId":"25740","inReplyTo":"1289689102-3507-1-git-send-email-martin.von.zweigbergk@gmail.com","subject":"Re: [PATCH v2] Use reflog in 'pull --rebase . foo'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-29T23:08:36Z","receivedAt":"2010-11-29T23:08:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Makes sense; thanks.\n"}]}