Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/neogit/integrations/diffview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ local function get_local_diff_view(section_name, item_name, opts)
table.insert(args, "HEAD")
end

return git.cli.show.file(unpack(args)).call({ trim = false }).stdout
return git.cli.show.file(unpack(args)).call({ async = false, trim = false }).stdout
elseif kind == "working" then
local fdata = git.cli.show.file(path).call({ trim = false }).stdout
local fdata = git.cli.show.file(path).call({ async = false, trim = false }).stdout
return side == "left" and fdata
end
end,
Expand Down
10 changes: 5 additions & 5 deletions lua/neogit/lib/git/branch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function M.get_recent_local_branches()
end

function M.checkout(name, args)
git.cli.checkout.branch(name).arg_list(args or {}).call()
git.cli.checkout.branch(name).arg_list(args or {}).call { async = false }

if config.values.fetch_after_checkout then
local pushRemote = M.pushRemote_ref(name)
Expand All @@ -78,7 +78,7 @@ function M.checkout(name, args)
end

function M.track(name, args)
git.cli.checkout.track(name).arg_list(args or {}).call()
git.cli.checkout.track(name).arg_list(args or {}).call { async = false }
end

function M.get_local_branches(include_current)
Expand Down Expand Up @@ -139,7 +139,7 @@ end
---@param name string
---@param base_branch? string
function M.create(name, base_branch)
git.cli.branch.args(name, base_branch).call()
git.cli.branch.args(name, base_branch).call { async = false }
end

function M.delete(name)
Expand All @@ -149,10 +149,10 @@ function M.delete(name)
if M.is_unmerged(name) then
local message = ("'%s' contains unmerged commits! Are you sure you want to delete it?"):format(name)
if input.get_permission(message) then
result = git.cli.branch.delete.force.name(name).call()
result = git.cli.branch.delete.force.name(name).call { async = false }
end
else
result = git.cli.branch.delete.name(name).call()
result = git.cli.branch.delete.name(name).call { async = false }
end

return result and result.code == 0 or false
Expand Down
6 changes: 3 additions & 3 deletions lua/neogit/lib/git/cherry_pick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ function M.apply(commits, args)
end

function M.continue()
git.cli["cherry-pick"].continue.call()
git.cli["cherry-pick"].continue.call { async = false }
end

function M.skip()
git.cli["cherry-pick"].skip.call()
git.cli["cherry-pick"].skip.call { async = false }
end

function M.abort()
git.cli["cherry-pick"].abort.call()
git.cli["cherry-pick"].abort.call { async = false }
end

return M
1 change: 1 addition & 0 deletions lua/neogit/lib/git/cli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ local configurations = {

apply = config {
flags = {
ignore_space_change = "--ignore-space-change",
cached = "--cached",
reverse = "--reverse",
index = "--index",
Expand Down
2 changes: 1 addition & 1 deletion lua/neogit/lib/git/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function M.apply(patch, opts)
cmd = cmd.index
end

return cmd.with_patch(patch).call { async = false }
return cmd.ignore_space_change.with_patch(patch).call { async = false }
end

function M.add(files)
Expand Down
12 changes: 6 additions & 6 deletions lua/neogit/lib/git/status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,26 @@ end
---@class NeogitGitStatus
local status = {
stage = function(files)
git.cli.add.files(unpack(files)).call()
git.cli.add.files(unpack(files)).call { async = false }
end,
stage_modified = function()
git.cli.add.update.call()
git.cli.add.update.call { async = false }
end,
stage_untracked = function()
local paths = util.map(git.repo.state.untracked.items, function(item)
return item.escaped_path
end)

git.cli.add.files(unpack(paths)).call()
git.cli.add.files(unpack(paths)).call { async = false }
end,
stage_all = function()
git.cli.add.all.call()
git.cli.add.all.call { async = false }
end,
unstage = function(files)
git.cli.reset.files(unpack(files)).call()
git.cli.reset.files(unpack(files)).call { async = false }
end,
unstage_all = function()
git.cli.reset.call()
git.cli.reset.call { async = false }
end,
is_dirty = function()
return #git.repo.state.staged.items > 0 or #git.repo.state.unstaged.items > 0
Expand Down
2 changes: 1 addition & 1 deletion lua/neogit/popups/branch/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function M.rename_branch()
return
end

git.cli.branch.move.args(selected_branch, new_name).call()
git.cli.branch.move.args(selected_branch, new_name).call { async = false }

notification.info(string.format("Renamed '%s' to '%s'", selected_branch, new_name))
fire_branch_event("NeogitBranchRename", { branch_name = selected_branch, new_name = new_name })
Expand Down