|
21 | 21 |
|
22 | 22 | function M.create() |
23 | 23 | 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() |
53 | 51 |
|
54 | 52 | p:show() |
55 | 53 |
|
|
0 commit comments