summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-parse-remote.sh10
-rwxr-xr-xt/t5520-pull.sh7
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