Skip to content

Commit 51fa479

Browse files
committed
address nitpicks
Signed-off-by: Taylor Silva <dev@taydev.net>
1 parent 6c32a1a commit 51fa479

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

out_command.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
4949
}
5050

5151
var targetCommitish string
52-
commitishSpecified := false
5352
if request.Params.CommitishPath != "" {
54-
commitishSpecified = true
5553
targetCommitish, err = c.fileContents(filepath.Join(sourceDir, request.Params.CommitishPath))
5654
if err != nil {
5755
return OutResponse{}, err
@@ -99,10 +97,8 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
9997
existingRelease.Draft = github.Bool(draft)
10098
existingRelease.Prerelease = github.Bool(prerelease)
10199

102-
if commitishSpecified {
100+
if targetCommitish != "" {
103101
existingRelease.TargetCommitish = github.String(targetCommitish)
104-
} else {
105-
existingRelease.TargetCommitish = nil
106102
}
107103

108104
if bodySpecified {

out_command_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ var _ = Describe("Out Command", func() {
185185
})
186186

187187
Context("when a commitish is not supplied", func() {
188-
It("does not update the target commitish", func() {
188+
It("updates the existing release", func() {
189189
_, err := command.Run(sourcesDir, request)
190190
Ω(err).ShouldNot(HaveOccurred())
191191

@@ -194,7 +194,7 @@ var _ = Describe("Out Command", func() {
194194
updatedRelease := githubClient.UpdateReleaseArgsForCall(0)
195195
Ω(*updatedRelease.Name).Should(Equal("v0.3.12"))
196196
Ω(*updatedRelease.Body).Should(Equal("this is a great release"))
197-
Ω(updatedRelease.TargetCommitish).Should(BeNil())
197+
Ω(updatedRelease.TargetCommitish).Should(BeNil(), "does not set the TargetCommitish")
198198
})
199199
})
200200

0 commit comments

Comments
 (0)