1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

more password checks on commands that talk to the remote

This commit is contained in:
Jesse Duffield
2020-10-12 19:04:20 +11:00
parent 3df0a9f132
commit 031e97ef91
6 changed files with 20 additions and 12 deletions

View File

@ -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