-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ #440 | more correct way to check branch #467
Conversation
@phuonglm @hieptranquoc please review this asap |
@@ -130,11 +131,14 @@ def check_branch(current_ref, desired_branch) | |||
|
|||
@logger.debug("current_branch: #{current_branch} - desired_branch: #{desired_branch}") | |||
|
|||
local_branch = `git branch -a | grep -v "HEAD detached" | grep -r "#{desired_branch}"`.strip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the proper way to get the local branch:
teracy-dev hoatle$ git branch -a | grep -v "HEAD detached" | grep -r "develop"
(standard input):* develop
(standard input): remotes/datphan/develop
(standard input): remotes/origin/HEAD -> origin/develop
(standard input): remotes/origin/develop
(standard input): remotes/upstream/develop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a check for desired branch, not to get it, it is more correct than the current way,
to resolve some issues like branch name contains
\
or ref is atdetached HEAD
connect #440