Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 411002

Summary: ArrayIndexOutOfBoundsException in CreateBranchCommand
Product: [Technology] JGit Reporter: Oliver Pfeiffer <oliver.pfeiffer>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: johannes.roeder, matthias.sohn, oliver.pfeiffer, robin.rosenberg, robin
Version: 3.3Keywords: helpwanted
Target Milestone: 3.4   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Stack trace of the thrown exception none

Description Oliver Pfeiffer CLA 2013-06-18 05:46:36 EDT
Created attachment 232488 [details]
Stack trace of the thrown exception

Creating a new branch from master in "Git Repositories" view, pressing the finish button in the popup dialog results in an error dialog stating that the branch couldn't be created. The aforementioned exception is saved in the log whose full trace is attached. However, the branch actually gets created, only the dialogs keep open. Unfortunately, I have not been able to reproduce the exact circumstances under which this happens so far.
Comment 1 Steve Elsemore CLA 2013-06-18 18:58:11 EDT
To reproduce:

1.  Rename Remote Tracking branch so that it will have no '/' in name.  i.e., "origin/master" -> "master"
2.  Right-click renamed branch and select "Create Branch..."
3.  Provide a name for new branch and click Finish.  ArrayIndexOutOfBoundsException.
Comment 2 Johannes Röder CLA 2013-06-24 09:14:39 EDT
Happens to me too.

I created a repository from SVN (git svn clone), and the created remote branches don't have anything like "origin\" prepended.

I kind of followed the most basic steps I could find online to evaluate Git/EGit (coming from SVN), so I guess basically everybody trying this (with more than one branch) will sooner or later run into this issue.

A workaround to this issue is using Steves steps backwards: Rename your remote branches to something including "/", and everything works like a charm.
Comment 4 Matthias Sohn CLA 2014-04-27 10:23:34 EDT
(In reply to Robin Rosenberg from comment #3)
> 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