Skip to content

Commit 938636c

Browse files
authored
fix: push heads along with tags (#35)
1 parent ef45917 commit 938636c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/git/mod.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func CreateTag(repo *Repository, name, message string) error {
128128
return err
129129
}
130130

131-
func PushTagsToOrigin(repo *Repository, auth AuthMethod) error {
131+
func PushToOrigin(repo *Repository, auth AuthMethod) error {
132132
// skip pushing if remote doesn't exist
133133
if _, err := repo.Remote("origin"); err != nil {
134134
return nil
@@ -137,7 +137,10 @@ func PushTagsToOrigin(repo *Repository, auth AuthMethod) error {
137137
pushOpts := &git.PushOptions{
138138
RemoteName: "origin",
139139
Progress: os.Stdout,
140-
RefSpecs: []config.RefSpec{config.RefSpec("refs/tags/*:refs/tags/*")},
140+
RefSpecs: []config.RefSpec{
141+
config.RefSpec("refs/heads/*:refs/heads/*"),
142+
config.RefSpec("refs/tags/*:refs/tags/*"),
143+
},
141144
Auth: auth,
142145
}
143146

pkg/gitsemver/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (p *Project) Bump(versionFilenamesAndKeys []string, auth AuthMethod, vPrefi
251251
return err
252252
}
253253

254-
if err := git.PushTagsToOrigin(p.Repo(), auth); err != nil {
254+
if err := git.PushToOrigin(p.Repo(), auth); err != nil {
255255
return err
256256
}
257257

0 commit comments

Comments
 (0)