Fix error when issuing git pull on remote-only branch
What does this MR do?
This MR fixes the error returned by git when issuing a git pull
against a branch that does not exist in the local copy of gemnasium-db
.
Discussion
The approach I chose adds yet another git command to verify the state of the checkout. This is overly complicated and I'm in the search of something simpler and welcome suggestions.
Note: I broke up the conditional git pull out into a separate updateRef
func as Update
was getting a little hard to follow. I'm not sure if this is the best way. Looking for input here too.
What are the relevant issue numbers?
gitlab-org/gitlab#294296 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Igor Frenkel