Skip to content

Commit

Permalink
branch submit: Fix "branch is not tracked" warning with --no-publish (#…
Browse files Browse the repository at this point in the history
…281)

Part of the code responsible for updating the comments in PRs
will print a warning when --no-publish is used.

Resolves #277
  • Loading branch information
abhinav authored Jul 23, 2024
1 parent dd36865 commit a4d0ef9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Fixed-20240722-184205.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Fixed
body: >-
branch submit: Fix incorrect warning about current branch not being tracked
when --no-publish is used.
time: 2024-07-22T18:42:05.631607-07:00
2 changes: 1 addition & 1 deletion branch_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (cmd *branchSubmitCmd) run(
// TODO: this can be made optional with a --force or a prompt.
}

if !cmd.DryRun {
if !cmd.DryRun && !cmd.NoPublish {
session.branches = append(session.branches, cmd.Branch)
}

Expand Down
4 changes: 3 additions & 1 deletion testdata/script/branch_submit_no_publish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gs auth login
git add feature1.txt
gs bc -m feature1
gs branch submit --no-publish
stderr 'Pushed feature1'
cmp stderr $WORK/golden/first-submit.stderr

# verify no PRs
shamhub dump changes
Expand Down Expand Up @@ -67,6 +67,8 @@ feature 1
feature 1.2
-- repo/feature1.3.txt --
feature 1.3
-- golden/first-submit.stderr --
INF Pushed feature1
-- golden/no-pulls.txt --
[]
-- golden/no-comments.txt --
Expand Down

0 comments on commit a4d0ef9

Please sign in to comment.