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

Bug 349810

Summary: [client] [git] Git Status page fails when trying to open for a repo with detached HEAD
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: libing wang <libingw>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw, simon_kaegi, Szymon.Brandys
Version: 0.2Flags: Szymon.Brandys: review+
simon_kaegi: review+
Target Milestone: 0.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tomasz Zarna CLA 2011-06-20 08:30:50 EDT
Steps:
1. Clone org.eclipse.orion.client
2. "git checkout 3949ce221c57cc567ac678ad65004a6a4900e2ec" which is a commit before Simon's "renaming org.eclipse.orion.client.core/static to /web" [1]
3. Link it to a folder in Orion
4. Open Git Status for the folder
=> SHOULD BE: empty status, nothing to commit, but when a change is made I should be able to stage it and commit
=> IS: The page hangs with "Loading status..." message and there is an error in console:

TypeError: this._curBranch is undefined
[Break On This Error] location = this._curClone.Name + " on " + this._curBranch.Name; 
http://localhost:8080/orion/git/git-status-table.js

[1]  http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=7d1ab0496245ee5a207827dc7314b250f9a955f8
Comment 1 Szymon Brandys CLA 2011-06-20 11:30:07 EDT
1) I talked to Simon and for RC3 we should do a null check at least. 

2) If the given branch JSON has Current=false it means we are in the detached mode. Then we should show the log for HEAD in the first mini-log and disable the remote one. We could also add a message somewhere saying that we are in the detached mode e.g. do not display the branch name in the header.
Comment 2 Szymon Brandys CLA 2011-06-20 13:38:28 EDT
The fix looks good, +1.
Comment 3 libing wang CLA 2011-06-20 14:53:45 EDT
fixed with a48ce0bb3d8a4ee5a2122ae9a0df39433d0f821b