Description
The range diff ref picker omits the current branch when opened from the status view with d → r. HEAD is available and points to the same commit, but the branch name itself is absent.
Tested with Neogit v3.0.0-219-g37e0f22a (37e0f22a2345bad1bffe01b31970885882f46275).
Neovim version
NVIM v0.12.3
Build type: Release
LuaJIT 2.1.1774638290
Operating system and version
macOS 26.6 (25G72)
Steps to reproduce
- Create a repository with
main and check out a branch named feature.
- Start Neovim in that repository with
nvim -nu minimal.lua.
- Run
:Neogit.
- Press
d, then r.
- Inspect the
Diff for range from choices.
Expected behavior
feature is offered as a range endpoint.
Actual behavior
The choices include main and HEAD, but not feature.
Minimal config
minimal.lua
vim.opt.runtimepath = { vim.env.VIMRUNTIME }
local root = vim.fn.fnamemodify(
debug.getinfo(1, "S").source:sub(2),
":p:h"
) .. "/.min/plugins/"
local plugins = {
plenary = "https://github.com/nvim-lua/plenary.nvim.git",
diffview = "https://github.com/sindrets/diffview.nvim",
neogit = "https://github.com/NeogitOrg/neogit",
}
vim.fn.mkdir(root, "p")
for name, url in pairs(plugins) do
local path = root .. name
if not vim.uv.fs_stat(path) then
vim.fn.system({ "git", "clone", "--depth=1", url, path })
assert(vim.v.shell_error == 0, "Failed to clone " .. name)
end
vim.opt.runtimepath:append(path)
end
require("neogit").setup({})
Additional context
The range action constructs its first candidate list as { commit, git.branch.current() or "HEAD" }. From the status view, commit is nil. Because util.merge uses ipairs, iteration stops before reaching the current branch at index 2. get_all_branches(false) also excludes the current branch, so no later candidate source adds it back.
Description
The range diff ref picker omits the current branch when opened from the status view with
d→r.HEADis available and points to the same commit, but the branch name itself is absent.Tested with Neogit
v3.0.0-219-g37e0f22a(37e0f22a2345bad1bffe01b31970885882f46275).Neovim version
Operating system and version
macOS 26.6 (25G72)
Steps to reproduce
mainand check out a branch namedfeature.nvim -nu minimal.lua.:Neogit.d, thenr.Diff for range fromchoices.Expected behavior
featureis offered as a range endpoint.Actual behavior
The choices include
mainandHEAD, but notfeature.Minimal config
minimal.lua
Additional context
The range action constructs its first candidate list as
{ commit, git.branch.current() or "HEAD" }. From the status view,commitisnil. Becauseutil.mergeusesipairs, iteration stops before reaching the current branch at index 2.get_all_branches(false)also excludes the current branch, so no later candidate source adds it back.util.mergeimplementation