Skip to content

Commit e55accd

Browse files
committed
repo: add PushWithEnvs
1 parent e05862f commit e55accd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const _VERSION = "0.6.9"
13+
const _VERSION = "0.7.0"
1414

1515
func Version() string {
1616
return _VERSION

repo.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,15 @@ func Pull(repoPath string, opts PullRemoteOptions) error {
176176
return err
177177
}
178178

179+
// PushWithEnvs pushs local commits to given remote branch with given environment variables.
180+
func PushWithEnvs(repoPath, remote, branch string, envs []string) error {
181+
_, err := NewCommand("push", remote, branch).AddEnvs(envs...).RunInDir(repoPath)
182+
return err
183+
}
184+
179185
// Push pushs local commits to given remote branch.
180186
func Push(repoPath, remote, branch string) error {
181-
_, err := NewCommand("push", remote, branch).RunInDir(repoPath)
182-
return err
187+
return PushWithEnvs(repoPath, remote, branch, nil)
183188
}
184189

185190
type CheckoutOptions struct {

0 commit comments

Comments
 (0)