Community
Participate
Working Groups
CreateBranchCommand does not support tracking remotes with "/" character in it. Step 1) Configure a remote, "github/asif" Step 2) Fetch branches from the remote, "github/asif" Step 3) Create Branch with starting point (or tracked to) "github/asif/master" CreateBranchCommand will create local branch "master" as follows, [branch "master"] remote = github merge = refs/heads/asif/master It should have been remote = github/asif. Btw, jGit as well as git cli allows creating remote with / characters in the name. After doing a bit of debugging, following snippet in class CreateBranchCommand causes the issue; It blindly tokenizes based of "/" which is not very clever as it breaks when remote name has "/" character. String[] tokens = baseBranch.split("/", 4); boolean isRemote = tokens[1].equals("remotes"); if (isRemote) { // refs/remotes/<remote name>/<branch> String remoteName = tokens[2]; String branchName = tokens[3]; config .setString(ConfigConstants.CONFIG_BRANCH_SECTION, name, ConfigConstants.CONFIG_KEY_REMOTE, remoteName); config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, name, ConfigConstants.CONFIG_KEY_MERGE, Constants.R_HEADS + branchName); }
Looks to be still a problem. The right thing to do would be to go through the remote name to see which one matches and then use the remaining part of the string for the branch name.
Patches: https://git.eclipse.org/r/#/c/25604/ https://git.eclipse.org/r/#/c/25603/1 https://git.eclipse.org/r/#/c/25605/
(In reply to Robin Rosenberg from comment #2) > Patches: > > https://git.eclipse.org/r/#/c/25604/ merged as 36f58ef867fc180aaca20dfa58a1b14f6b79e59a > https://git.eclipse.org/r/#/c/25603/1 merged as 6605255d9906c5277d215396ebcc395484b9f10c > https://git.eclipse.org/r/#/c/25605/ merged as e329fb8c8d0afa6a93cd73c8b7978ff77db05c81