Skip to content

Commit 99c1762

Browse files
committed
Merge branch 'mz/pull-rebase-rebased' into next
* mz/pull-rebase-rebased: Use reflog in 'pull --rebase . foo'
2 parents 1869996 + fe249b4 commit 99c1762

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

git-parse-remote.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,13 @@ get_remote_merge_branch () {
8989
refs/heads/*) remote=${remote#refs/heads/} ;;
9090
refs/* | tags/* | remotes/* ) remote=
9191
esac
92-
93-
[ -n "$remote" ] && echo "refs/remotes/$repo/$remote"
92+
[ -n "$remote" ] && case "$repo" in
93+
.)
94+
echo "refs/heads/$remote"
95+
;;
96+
*)
97+
echo "refs/remotes/$repo/$remote"
98+
;;
99+
esac
94100
esac
95101
}

t/t5520-pull.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,11 @@ test_expect_success 'git pull --rebase does not reapply old patches' '
222222
)
223223
'
224224

225+
test_expect_success 'git pull --rebase against local branch' '
226+
git checkout -b copy2 to-rebase-orig &&
227+
git pull --rebase . to-rebase &&
228+
test "conflicting modification" = "$(cat file)" &&
229+
test file = "$(cat file2)"
230+
'
231+
225232
test_done

0 commit comments

Comments
 (0)