1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00

Make Heroku destination refspec more specific.

This commit is contained in:
Gary Borton 2014-12-16 04:04:27 -05:00
parent 01ca940add
commit d4434c2a27
2 changed files with 4 additions and 4 deletions

View File

@ -44,10 +44,10 @@ func (h *Heroku) Write(f *buildfile.Buildfile) {
// that need to be deployed to Heroku.
f.WriteCmd(fmt.Sprintf("git add -A"))
f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'"))
f.WriteCmd(fmt.Sprintf("git push heroku HEAD:master --force"))
f.WriteCmd(fmt.Sprintf("git push heroku HEAD:refs/heads/master --force"))
case false:
// otherwise we just do a standard git push
f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:master"))
f.WriteCmd(fmt.Sprintf("git push heroku $COMMIT:refs/heads/master"))
}
}

View File

@ -57,7 +57,7 @@ func Test_Heroku(t *testing.T) {
d.Write(b)
out := b.String()
g.Assert(strings.Contains(out, "\ngit push heroku $COMMIT:master\n")).Equal(true)
g.Assert(strings.Contains(out, "\ngit push heroku $COMMIT:refs/heads/master\n")).Equal(true)
})
g.It("Should force push to remote", func() {
@ -71,7 +71,7 @@ func Test_Heroku(t *testing.T) {
out := b.String()
g.Assert(strings.Contains(out, "\ngit add -A\n")).Equal(true)
g.Assert(strings.Contains(out, "\ngit commit -m 'adding build artifacts'\n")).Equal(true)
g.Assert(strings.Contains(out, "\ngit push heroku HEAD:master --force\n")).Equal(true)
g.Assert(strings.Contains(out, "\ngit push heroku HEAD:refs/heads/master --force\n")).Equal(true)
})
})