diff options
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/remotes.go | 7 | ||||
-rw-r--r-- | pkg/commands/tags.go | 7 |
2 files changed, 10 insertions, 4 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 diff --git a/pkg/commands/tags.go b/pkg/commands/tags.go index f7b26d8df..121637311 100644 --- a/pkg/commands/tags.go +++ b/pkg/commands/tags.go @@ -1,5 +1,7 @@ package commands +import "fmt" + func (c *GitCommand) CreateLightweightTag(tagName string, commitSha string) error { return c.OSCommand.RunCommand("git tag %s %s", tagName, commitSha) } @@ -8,6 +10,7 @@ func (c *GitCommand) DeleteTag(tagName string) error { return c.OSCommand.RunCommand("git tag -d %s", tagName) } -func (c *GitCommand) PushTag(remoteName string, tagName string) error { - return c.OSCommand.RunCommand("git push %s %s", remoteName, tagName) +func (c *GitCommand) PushTag(remoteName string, tagName string, promptUserForCredential func(string) string) error { + command := fmt.Sprintf("git push %s %s", remoteName, tagName) + return c.OSCommand.DetectUnamePass(command, promptUserForCredential) } |