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

Bug 401463

Summary: Pushing to remote branch with different name fails
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: GitAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: simon_kaegi, Szymon.Brandys
Version: 2.0Flags: mamacdon: review+
mamacdon: review+
Target Milestone: 2.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-02-21 15:12:55 EST
1. Checkout the master branch of some repository.
2. Click "Push All", then click "More"
3. The Choose Branch dialog appears. 
4. Using the mouse, click "origin" in the branch tree. (This should enable the "New Branch:" text field -- workarond for a focus bug).
5. Enter a branch name in the New Branch field. Click OK.

I see an error message saying "One of setGitDir or setWorkTree must be called". The push fails.

The failing request/response look like this:

Request
> POST  gitapi/remote/origin/new_branch/file/mamacdon 
> {"PushSrcRef":"HEAD","PushTags":true,"Force":false,"GitSshUsername":"","GitSshPassword":"","GitSshKnownHost":"dev.eclipse.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAuKF3Ly38celFqKvVs1nAikEnNHxfW/nvg5mE/nOJQJNWMcNX/yxsr3pxfYWW5EVVDQ+SYUtpJjP36m04jaai/nHBuJTa4diubdzYM/wA4ZMf0zef2LqY/+aE6o3TGbKR3N181pXRBfKeOm92Vig4pLINoV3Im0ebblz6HDDrNtE=","GitSshPrivateKey":"","GitSshPassphrase":""}
Response
> 500 Server Error
> {"HttpCode":500,"DetailedMessage":"One of setGitDir or setWorkTree must be called.","Message":"Error pushing git repository","Severity":"Error","Code":0}
Comment 1 Simon Kaegi CLA 2013-02-21 15:29:02 EST
Szymon - please take a look (not saying we will fix it for 2.0 but...)
Comment 2 Malgorzata Janczarska CLA 2013-02-22 11:56:03 EST
I fixed this particular case for now, so that we can fix it for 2.0, but it was caused by crafting URLs on UI, so I guess it would be good to look the whole code though in 3.0 and try to address all those cases better.

Review request:
https://orion.eclipse.org/git/reviewRequest.html#ssh://git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git_7d11f60129aa8d1589f2ded4d234738601c7252e
Commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=Bug401463_newBranchPushing&id=7d11f60129aa8d1589f2ded4d234738601c7252e
Comment 3 Simon Kaegi CLA 2013-02-22 12:01:30 EST
I'm happy with the scope but want Mark to try it out too.
Comment 4 Mark Macdonald CLA 2013-02-22 12:26:02 EST
Seems ok, and it works. +
Comment 5 Mark Macdonald CLA 2013-02-22 12:26:33 EST
bugzilla sucks
Comment 6 Malgorzata Janczarska CLA 2013-02-22 12:43:31 EST
Pushed.