Skip to content

Commit d9a6dde

Browse files
skarimCopilot
andcommitted
only recommend submit if stack exists on remote
Co-authored-by: Copilot <copilot@github.com>
1 parent 7636f50 commit d9a6dde

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

cmd/modify.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ func runModify(cfg *config.Config) error {
135135
}
136136

137137
// Print success summary
138-
printModifySuccess(cfg, applyResult)
138+
printModifySuccess(cfg, applyResult, s.ID != "")
139139

140140
return nil
141141
}
142142

143143
// printModifySuccess prints a summary of what was applied.
144-
func printModifySuccess(cfg *config.Config, result *modifyview.ApplyResult) {
144+
func printModifySuccess(cfg *config.Config, result *modifyview.ApplyResult, hasRemoteStack bool) {
145145
if result == nil {
146146
return
147147
}
@@ -164,8 +164,10 @@ func printModifySuccess(cfg *config.Config, result *modifyview.ApplyResult) {
164164
}
165165

166166
cfg.Printf("")
167-
cfg.Printf("Run `%s` to push your changes and update the stack of PRs on GitHub",
168-
cfg.ColorCyan("gh stack submit"))
167+
if hasRemoteStack {
168+
cfg.Printf("Run `%s` to push your changes and update the stack of PRs on GitHub",
169+
cfg.ColorCyan("gh stack submit"))
170+
}
169171
}
170172

171173
// runModifyRecover handles recovery from a crashed modify session.

internal/modify/apply.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,11 @@ func ContinueApply(
626626
}
627627

628628
cfg.Successf("Stack modified successfully")
629-
cfg.Printf("")
630-
cfg.Printf("Run `%s` to push your changes and update the stack of PRs on GitHub",
631-
cfg.ColorCyan("gh stack submit"))
629+
if state.PriorRemoteStackID != "" {
630+
cfg.Printf("")
631+
cfg.Printf("Run `%s` to push your changes and update the stack of PRs on GitHub",
632+
cfg.ColorCyan("gh stack submit"))
633+
}
632634
return nil
633635
}
634636

0 commit comments

Comments
 (0)