origin: when using 'oc new-app url#branch' to pull specific branch ,I find a bug.

description

when using ‘oc new-app url#branch’ to pull specific branch ,I find a bug.

if the name of branch is “openshift”, i will get the master branch instead of ‘openshift’ branch when creanting an application

eg:

oc new-app http://xxxxx.git#openshift

if i execute this command , i will create an application from a remote repository using its master branch instead of openshift branch.

version

oc v1.4.1+3f9807a kubernetes v1.4.0+776c994 features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://cc.d.xxxxx.net:443 openshift v1.4.1 kubernetes v1.4.0+776c994 #

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (18 by maintainers)

Most upvoted comments

it looks like we can fix this in code by specifying a “–” after the branch name we are checking out, to avoid git getting confused as to whether we should check out the file or the branch, i’ll let @gabemontero take care of that since he’s fixing up some other git checkout issues anyway.

but again in the meantime, renaming your branch so it does not match the name of a file/dir in your repo should be a valid workaround.

Odd … not seeing the error noted in https://github.com/openshift/origin/issues/13933#issuecomment-299313559 today, though I had to re-gen the change in doing so.

Perhaps I somehow coded it incorrectly before when passing args to git

I’ll do so more complete testing, but assuming success, should have a PR submitted after https://github.com/openshift/origin/pull/14025 merges

thanks,I think it is better to fix this bug in code

it’s going to be fixed in code, that is why i did not close the issue. but getting a fix to you will take time, so i suggest you use the workaround.