From d4434c2a27c63bc583d59502b62b88aceaf9bf55 Mon Sep 17 00:00:00 2001 From: Gary Borton Date: Tue, 16 Dec 2014 04:04:27 -0500 Subject: [PATCH] Make Heroku destination refspec more specific. --- plugin/deploy/heroku/heroku.go | 4 ++-- plugin/deploy/heroku/heroku_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/deploy/heroku/heroku.go b/plugin/deploy/heroku/heroku.go index 35a80c0e..7a551fbb 100644 --- a/plugin/deploy/heroku/heroku.go +++ b/plugin/deploy/heroku/heroku.go @@ -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")) } } diff --git a/plugin/deploy/heroku/heroku_test.go b/plugin/deploy/heroku/heroku_test.go index f4a88b83..e5a8eeef 100644 --- a/plugin/deploy/heroku/heroku_test.go +++ b/plugin/deploy/heroku/heroku_test.go @@ -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) }) })