Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Nov 15, 2023
1 parent a4669f7 commit 4739485
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/neogit/popups/ignore/actions.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local M = {}

local Path = require("plenary.path")
local git = require("neogit.lib.git")
local operation = require("neogit.operations")
Expand All @@ -17,7 +18,7 @@ local function make_rules(popup, relative)
end, files))
end

---@param path
---@param path Path
---@param rules string[]
local function add_rules(path, rules)
local selected = FuzzyFinderBuffer.new(rules)
Expand All @@ -27,7 +28,7 @@ local function add_rules(path, rules)
return
end

path:write(table.concat(selected, "\n") .. "\n", "a+", 438)
path:write(table.concat(selected, "\n") .. "\n", "a+")
end

M.shared_toplevel = operation("ignore_shared", function(popup)
Expand All @@ -42,7 +43,7 @@ M.shared_subdirectory = operation("ignore_subdirectory", function(popup)
if subdirectory then
subdirectory = Path:new(vim.loop.cwd(), subdirectory)

local ignore_file = subdirectory:join(".gitignore")
local ignore_file = subdirectory:joinpath(".gitignore")
local rules = make_rules(popup, tostring(subdirectory))

add_rules(ignore_file, rules)
Expand Down

0 comments on commit 4739485

Please sign in to comment.