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
Make merge working for all remote branches (not only master) #16430
Conversation
@paulslaby In the lib/git_worktree there are multiple references to master Line 9 in f9f5aef
Won't all of these have to be fixed. I am wondering if there is a bug in manageiq/app/models/git_repository.rb Line 90 in f9f5aef
Shouldn't this be calling just fetch, since we are only working with bare repos, and the user is not allowed to change the bare repo. So I am not sure why we would be merging anything |
@mkanoor Thanks for the reply. In git ecosystem fetch only refreshes information about remotes. We need to do something like You are right, that I could remove MASTER_REF completely, so I will, do it. |
9cc8732
to
627a08b
Compare
@mkanoor Hello again, I removed all hard-coded references to master. What do you think now? I wanted to write tests, but I do not know, how to mock remote repository. |
@paulslaby The lib/gitworktree was part of a project related to implementing Automate models in a Git database. In that model the master branch was the only branch that was being allowed. So I would not remove the MASTER references completely. manageiq/app/models/git_repository.rb Line 90 in f9f5aef
Change that to fetch and it will solve your problem. |
@mkanoor Thank you for you tip. Unfortunately, it does not work. |
@paulslaby I have been trying to add tests but the specs were getting stuck. So I need to figure that out first. |
@paulslaby Have you looked at the Travis failures. |
Checked commit paulslaby@0c55372 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mkanoor Travis is timing out from unknown reason for me. Have you faced it already? |
@paulslaby |
@mkanoor Thank you. I am closing this one as your one will resolve it. |
Git repository had master branch hard-coded. I replaced it with actualy checked-out branch.
Links
Steps for Testing/QA
If you create a repository with no master branch and want to import it to automate, it failed. Now it is fixed. More information in Bugzilla