Skip to content

Commit 1af13af

Browse files
ten3robertspritchett
authored andcommitted
fix: stylua
1 parent 6550061 commit 1af13af

File tree

4 files changed

+33
-35
lines changed

4 files changed

+33
-35
lines changed

lua/neogit/lib/git/branch.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ function M.prompt_for_branch(options, configuration)
6464
})
6565

6666
if c.truncate_remote_name_from_options and not c.truncate_remote_name then
67-
error("invalid prompt_for_branch configuration, \"truncate_remote_name_from_options\" cannot be \"true\" when \"truncate_remote_name\" is \"false\".")
67+
error(
68+
'invalid prompt_for_branch configuration, "truncate_remote_name_from_options" cannot be "true" when "truncate_remote_name" is "false".'
69+
)
6870
return nil
6971
end
7072

lua/neogit/popups/fetch.lua

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,33 @@ end
2121

2222
function M.create()
2323
local p = popup
24-
.builder()
25-
:name("NeogitFetchPopup")
26-
:switch("p", "prune", "Prune deleted branches", false)
27-
:switch("t", "tags", "Fetch all tags", false)
28-
:action("p", "Fetch from pushremote", function(popup)
29-
30-
fetch_from("pushremote", "origin", status.repo.head.branch, popup:get_arguments())
31-
end)
32-
:action("u", "Fetch from upstream", function(popup)
33-
34-
local upstream = git.branch.get_upstream()
35-
if not upstream then
36-
return
37-
end
38-
39-
fetch_from(upstream.remote, upstream.remote, "", popup:get_arguments())
40-
end)
41-
:action("a", "Fetch from all remotes", function(popup)
42-
local args = popup:get_arguments()
43-
table.insert(args, "--all")
44-
45-
fetch_from("all remotes", "", "", args)
46-
end)
47-
:action("e", "Fetch from elsewhere", function(popup)
48-
local remote = input.get_user_input("remote: ")
49-
local branch = git.branch.prompt_for_branch()
50-
fetch_from(remote .. ' ' .. branch, remote, branch, popup:get_arguments())
51-
end)
52-
:build()
24+
.builder()
25+
:name("NeogitFetchPopup")
26+
:switch("p", "prune", "Prune deleted branches", false)
27+
:switch("t", "tags", "Fetch all tags", false)
28+
:action("p", "Fetch from pushremote", function(popup)
29+
fetch_from("pushremote", "origin", status.repo.head.branch, popup:get_arguments())
30+
end)
31+
:action("u", "Fetch from upstream", function(popup)
32+
local upstream = git.branch.get_upstream()
33+
if not upstream then
34+
return
35+
end
36+
37+
fetch_from(upstream.remote, upstream.remote, "", popup:get_arguments())
38+
end)
39+
:action("a", "Fetch from all remotes", function(popup)
40+
local args = popup:get_arguments()
41+
table.insert(args, "--all")
42+
43+
fetch_from("all remotes", "", "", args)
44+
end)
45+
:action("e", "Fetch from elsewhere", function(popup)
46+
local remote = input.get_user_input("remote: ")
47+
local branch = git.branch.prompt_for_branch()
48+
fetch_from(remote .. " " .. branch, remote, branch, popup:get_arguments())
49+
end)
50+
:build()
5351

5452
p:show()
5553

lua/neogit/popups/help.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function M.create(env)
3232
require("neogit.popups.branch").create()
3333
end)
3434
:action("f", "Fetch", function()
35-
require('neogit.popups.fetch').create()
35+
require("neogit.popups.fetch").create()
3636
end)
3737
:action("$", "Git Command History", function()
3838
GitCommandHistory:new():show()

lua/neogit/popups/pull.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ function M.create()
8080
end
8181
end
8282

83-
local branch = git.branch.prompt_for_branch(
84-
branch_options,
85-
{ truncate_remote_name_from_options = true }
86-
)
83+
local branch =
84+
git.branch.prompt_for_branch(branch_options, { truncate_remote_name_from_options = true })
8785
if not branch then
8886
notif.create("Aborting pull because there is no branch")
8987
return

0 commit comments

Comments
 (0)