Issue 2755: Cherry-pick to button creates patch for refs/branch
Status:  Accepted
Owner: ----
Reported by cascaran...@gmail.com, Jul 3, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version:

What steps will reproduce the problem?
1.create a patch and merge it for a branch
2.in the ui, click 'cherri-pick' button 
3.select a branch only using the name (not using refs/heads/ prefix)

What is the expected output? What do you see instead?
Expected: A new change is created for the specified branch
Actual result: A new change is created for the branch refs/mybranch


Please provide any additional information below.
It's only happenig in one of our projects
It does not happen if you specify the full path (reds/heads/mybranch)
We are using gerrit 2.8
Jul 23, 2014
Project Member #1 david.pu...@sonymobile.com
Does the project have a branch named refs/mybranch in addition to refs/heads/mybranch?

Status: AwaitingInformation
Jul 23, 2014
#2 cascaran...@gmail.com
No it does not, or at least it does not show up on the ui or with git branch -a.

There's though a 'ref/for/master' and 'resf/for/master' that I have to clean up.
Jul 23, 2014
Project Member #4 david.pu...@sonymobile.com
Try it with `git ls-remote`

`git branch -a` will only show you the refs under refs/heads
Jul 23, 2014
#5 cascaran...@gmail.com
Good to know :)

So yes, theere's a refs/branchname there, Is that an issue?

If so, how can I get rid of it?

ps. I thought that branches were only the ones under refs/heads, so I was looking for refs/heads/refs/branchname
Jul 23, 2014
Project Member #6 david.pu...@sonymobile.com
> So yes, theere's a refs/branchname there, Is that an issue?

Not necessarily.  It's perfectly valid to have that as a ref in git.  However it seems that it is not handled correctly by Gerrit's cherry pick implementation.

> how can I get rid of it?

If you want to remove it, you can do it with:

 git push origin :refs/branchname

although you'll want to make sure there's nothing on there that is needed, before doing that.

Status: Accepted
Jul 23, 2014
Project Member #7 david.pu...@sonymobile.com
>  It's perfectly valid to have that as a ref in git

Hmm, it seems that actually it's not valid.

How did you manage to create it?

Jul 23, 2014
#8 cascaran...@gmail.com
I don't know, I just discovered it was there.