Skip to content

Commit 9244bd4

Browse files
fin-wibhagwan
authored andcommitted
fix(git_branch_del): update regex to reflect new git branch entries
1 parent 7839b7f commit 9244bd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/fzf-lua/actions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ M.git_branch_del = function(selected, opts)
879879
if #selected == 0 then return end
880880
local cmd_del_branch = path.git_cwd(opts.cmd_del, opts)
881881
local cmd_cur_branch = path.git_cwd({ "git", "rev-parse", "--abbrev-ref", "HEAD" }, opts)
882-
local branch = selected[1]:match("[^%s%*]+")
882+
local branch = selected[1]:match("^[%*+]*[%s]*[(]?([^%s)]+)")
883883
local cur_branch = utils.io_systemlist(cmd_cur_branch)[1]
884884
if branch == cur_branch then
885885
utils.warn("Cannot delete active branch '%s'", branch)

0 commit comments

Comments
 (0)