From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: git@vger.kernel.org, gitster@pobox.com, santi@agolina.net,
schwab@linux-m68k.org
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Subject: [PATCH v2] Use reflog in 'pull --rebase . foo'
Date: Sat, 13 Nov 2010 23:58:22 +0100 [thread overview]
Message-ID: <1289689102-3507-1-git-send-email-martin.von.zweigbergk@gmail.com> (raw)
Since c85c792 (pull --rebase: be cleverer with rebased upstream
branches, 2008-01-26), "git pull --rebase" has used the reflog to try to
rebase from the old upstream onto the new upstream.
Make this work if the local repository is explicitly passed on the
command line as in 'git pull --rebase . foo'.
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Acked-by: Santi Béjar <santi@agolina.net>
---
Changes since v1: Removed some stuff that I should not have included in
the first place. (Thanks Santi and Andreas.)
git-parse-remote.sh | 10 ++++++++--
t/t5520-pull.sh | 7 +++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 5f47b18..375a0ba 100644
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -89,7 +89,13 @@ get_remote_merge_branch () {
refs/heads/*) remote=${remote#refs/heads/} ;;
refs/* | tags/* | remotes/* ) remote=
esac
-
- [ -n "$remote" ] && echo "refs/remotes/$repo/$remote"
+ [ -n "$remote" ] && case "$repo" in
+ .)
+ echo "refs/heads/$remote"
+ ;;
+ *)
+ echo "refs/remotes/$repo/$remote"
+ ;;
+ esac
esac
}
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 0b489f5..0470a81 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -222,4 +222,11 @@ test_expect_success 'git pull --rebase does not reapply old patches' '
)
'
+test_expect_success 'git pull --rebase against local branch' '
+ git checkout -b copy2 to-rebase-orig &&
+ git pull --rebase . to-rebase &&
+ test "conflicting modification" = "$(cat file)" &&
+ test file = "$(cat file2)"
+'
+
test_done
--
1.7.3.2.167.ga361b
next reply other threads:[~2010-11-14 5:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-13 22:58 Martin von Zweigbergk [this message]
2010-11-29 23:08 ` [PATCH v2] Use reflog in 'pull --rebase . foo' Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289689102-3507-1-git-send-email-martin.von.zweigbergk@gmail.com \
--to=martin.von.zweigbergk@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=santi@agolina.net \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).