Skip to content
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

fix(mr.create): consider remote branches #297

Merged

Conversation

levouh
Copy link

@levouh levouh commented May 3, 2024

Fix #296

@levouh levouh marked this pull request as draft May 3, 2024 17:05
@levouh
Copy link
Author

levouh commented May 3, 2024

Converting to draft to test first, will move back when testing is done.

@levouh levouh marked this pull request as ready for review May 3, 2024 17:11
return run_system({ "git", "branch" })
M.branches = function(args)
-- Load here to prevent loop
local u = require("gitlab.utils")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it is worth adding a require_on_index implementation to gitlab.nvim, as I am not sure how often this is actually an issue (require loops). But this can also be solved by adding something like:

M.require_on_index = function(require_path)
  return setmetatable({}, {
    __index = function(_, key)
      return require(require_path)[key]
    end,

    __newindex = function(_, key, value)
      require(require_path)[key] = value
    end,
  })
end

and then doing:

local u = require("gitlab.util.lazy").require_on_index("gitlab.utils")

And since it is not required until it is used, you do not run into the same require looping stuff that causes this to be necessary.

@harrisoncramer harrisoncramer changed the base branch from main to develop May 5, 2024 15:01
@harrisoncramer harrisoncramer merged commit 3dabc55 into harrisoncramer:develop May 5, 2024
6 checks passed
harrisoncramer added a commit that referenced this pull request May 5, 2024
fix: List remote branches for merge targets (#293)
fix: consider remote branches (#297)
fix: Save popup contents to temp_registers (#294) 

This is a #PATCH release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create MR branch logic does not include remote branches
2 participants