From 031e97ef91654a53e7e534e7d4aa032e06eee319 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 12 Oct 2020 19:04:20 +1100 Subject: more password checks on commands that talk to the remote --- pkg/commands/tags.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/commands/tags.go') 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) } -- cgit v1.2.3