~ | | Default upstream is origin/master, so to test this behavior we need to have branches with merge set to some other remote branch. |
| ~ | I developed a test case to pass with branch "mybranch", for which it passed. Switching test branch name to "my/branch" made it fail. Second commit which introduces slash-friendly stripping method makes it pass again. |
- | |
|
- | | Then with current master, we get:
|
- | | che@nok ~/ipcorder/opengit/rbtools/rbtools $ git checkout fffff1
|
- | | Switched to branch 'fffff1'
|
- | | che@nok ~/ipcorder/opengit/rbtools/rbtools $ post-review -nd
|
- | | (...)
|
- | | >>> git config --get branch.fffff1.merge
|
- | | >>> git config --get branch.fffff1.remote
|
- | | >>> git config remote.origin.url
|
- | | >>> repository info: Path: git://github.com/reviewboard/rbtools.git, Base path: , Supports changesets: False
|
- | | >>> git merge-base origin/fooo refs/heads/fffff1
|
- | | (seems ok) |
- | |
|
- | | che@nok ~/ipcorder/opengit/rbtools/rbtools $ git checkout fffff/two
|
- | | Switched to branch 'fffff/two' |
- | | che@nok ~/ipcorder/opengit/rbtools/rbtools $ post-review -nd |
- | | |
- | | >>> git config --get branch.two.merge |
- | | >>> git config --get branch.two.remote |
- | | |
- | | >>> git config remote.origin.url |
- | | >>> repository info: Path: git://github.com/reviewboard/rbtools.git, Base path: , Supports changesets: False |
- | | >>> git merge-base origin/master refs/heads/fffff/two |
- | | (ended up with origin/master instead of configured upstream branch) |
- | | |
- | |
|
- | | With the patch:
|
- | | che@nok ~/ipcorder/opengit/rbtools/rbtools $ post-review -nd
|
- | | (...)
|
- | | >>> git config --get branch.fffff/two.merge
|
- | | >>> git config --get branch.fffff/two.remote
|
- | | >>> git config remote.origin.url
|
- | | >>> repository info: Path: git://github.com/reviewboard/rbtools.git, Base path: , Supports changesets: False
|
- | | >>> git merge-base origin/fooo refs/heads/fffff/two
|
- | | (seems to work fine now) |