diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-12 19:04:20 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-12 19:07:40 +1100 |
commit | 031e97ef91654a53e7e534e7d4aa032e06eee319 (patch) | |
tree | ebd41bc2f974e84ab01dee70f2413b688c6e6371 /pkg/commands/remotes.go | |
parent | 3df0a9f1322c5bb0e76967ee4b6ec3507ec41894 (diff) |
more password checks on commands that talk to the remote
Diffstat (limited to 'pkg/commands/remotes.go')
-rw-r--r-- | pkg/commands/remotes.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/commands/remotes.go b/pkg/commands/remotes.go index 6d69b37cd..779ce9e2b 100644 --- a/pkg/commands/remotes.go +++ b/pkg/commands/remotes.go @@ -1,6 +1,8 @@ package commands import ( + "fmt" + "github.com/jesseduffield/lazygit/pkg/commands/models" ) @@ -20,8 +22,9 @@ func (c *GitCommand) UpdateRemoteUrl(remoteName string, updatedUrl string) error return c.OSCommand.RunCommand("git remote set-url %s %s", remoteName, updatedUrl) } -func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string) error { - return c.OSCommand.RunCommand("git push %s --delete %s", remoteName, branchName) +func (c *GitCommand) DeleteRemoteBranch(remoteName string, branchName string, promptUserForCredential func(string) string) error { + command := fmt.Sprintf("git push %s --delete %s", remoteName, branchName) + return c.OSCommand.DetectUnamePass(command, promptUserForCredential) } // CheckRemoteBranchExists Returns remote branch |