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

Bug 479698

Summary: Git repositories, Reference bar shouldn't display "[New branch]"
Product: [ECD] Orion Reporter: xin chen <jiudechenxin>
Component: NodeAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ayl051, grant_gayed, mengzhixing0228, pwebster, Silenio_Quarti
Version: 10.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 474353    

Description xin chen CLA 2015-10-13 17:33:03 EDT
In git repositories page, the reference bar should display "master => origin/master" instead of "master => origin/master[New branch]"
Comment 1 Paul Webster CLA 2015-11-23 13:57:05 EST
How can I reproduce this probelm on https://orionhub.org ?

PW
Comment 2 Simon Meng CLA 2015-11-23 19:21:40 EST
(In reply to Paul Webster from comment #1)
> How can I reproduce this probelm on https://orionhub.org ?
> 
> PW

This bug only exists in node server, so I don't think it is possible to reproduce this problem on orionhub. In node server, you can check out the master branch and see if there is a "[New branch]" following the master branch.

Simon
Comment 3 Paul Webster CLA 2015-11-24 08:44:32 EST
(In reply to Simon Meng from comment #2)
> 
> This bug only exists in node server, so I don't think it is possible to
> reproduce this problem on orionhub. In node server, you can check out the
> master branch and see if there is a "[New branch]" following the master
> branch.

OK, then this is also a problem with the node server code, not the client code.  The return JSON from the node server is not quite correct.  You need to collect a set of working JSON responses from orionhub.org or from running the java server and then compare that to what is returned from the node server.  Use the Network view in your browser.

PW
Comment 4 Simon Meng CLA 2015-12-05 21:18:11 EST
Orionhub vs node server response can be found here, which is posted by Alvin. https://bugs.eclipse.org/bugs/attachment.cgi?id=258455&action=edit
Over this past 2 months, I narrowed this bug to several files: gitRepositoryExplorer.js, util.js(under git folder), commit.js, branches.js. The function shortenRefName(ref) in util.js decides whether to add "[New branch]" in the reference bar. This function is called several places in other files I mentioned above and this is where I have trouble with. The key step to debug is to find the difference between the structures of a newly-created local branch and a remote branch. I have used several strategies to differentiate these kinds of branches but they all seem not working properly. So the focus can be put on how to effectively differentiate these kinds of branches. Their structures can be compared using built-in web dev tools in Chrome/Safari.
Comment 5 Silenio Quarti CLA 2016-03-30 22:57:16 EDT
Fixed in latest