Make Heroku destination refspec more specific.
This commit is contained in:
parent
01ca940add
commit
d4434c2a27
2 changed files with 4 additions and 4 deletions
|
@ -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"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue