@@ -100,7 +100,8 @@ func hotfix() {
100
100
101
101
// Confirm that the release tag we're cherry-picking onto actually exists and
102
102
// is a tag.
103
- runOrDie (exec .Command ("git" , "rev-parse" , "--verify" , fmt .Sprintf ("%s^{tag}" , onto )))
103
+ committish := fmt .Sprintf ("%s^{tag}" , onto )
104
+ runOrDie (exec .Command ("git" , "rev-parse" , "--verify" , committish ))
104
105
105
106
// Check out the tag that is our starting point. This will put us into a
106
107
// "detached HEAD" state, but that's okay, because we're going to explicitly
@@ -145,9 +146,10 @@ func hotfix() {
145
146
// commits. This branch may or may not exist already, and it doesn't matter:
146
147
// when we push to it, it will either be updated or created, as appropriate.
147
148
branch := semver .MajorMinor (onto )
149
+ refspec := fmt .Sprintf ("HEAD:%s" , branch )
148
150
149
151
if push {
150
- runOrDie (exec .Command ("git" , "push" , "origin" , fmt . Sprintf ( "HEAD:%s" , branch ) , version ))
152
+ runOrDie (exec .Command ("git" , "push" , "origin" , refspec , version ))
151
153
} else {
152
154
fmt .Printf ("created tag %s on branch %s, exiting\n " , version , branch )
153
155
}
0 commit comments