Merge pull request #760 from gdborton/master

Make Heroku destination refspec more specific.
This commit is contained in:
Brad Rydzewski 2014-12-17 21:50:07 -08:00
commit 0452090358
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. // that need to be deployed to Heroku.
f.WriteCmd(fmt.Sprintf("git add -A")) f.WriteCmd(fmt.Sprintf("git add -A"))
f.WriteCmd(fmt.Sprintf("git commit -m 'adding build artifacts'")) 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: case false:
// otherwise we just do a standard git push // 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) d.Write(b)
out := b.String() 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() { g.It("Should force push to remote", func() {
@ -71,7 +71,7 @@ func Test_Heroku(t *testing.T) {
out := b.String() out := b.String()
g.Assert(strings.Contains(out, "\ngit add -A\n")).Equal(true) 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 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)
}) })
}) })