-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if $EDITOR env var is empty (#311)
Currently `OpenEditor` does not take into account when the $EDITOR env var is not set - in which case the Command just errors out and continues to ask the next question on whether to mark the PR as draft. The fix is quite simple - add a case for checking if the env var is set and return tea.Quit if that's the case. Fixes #310
- Loading branch information
Showing
5 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Fixed | ||
body: 'branch submit: Fail if Git editor is explicitly unset and there''s no fallback.' | ||
time: 2024-07-29T19:24:26.018128-07:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# branch submit fails if there's no editor. | ||
# https://github.com/abhinav/git-spice/issues/310 | ||
|
||
as 'Test <[email protected]>' | ||
at '2024-07-29T19:25:12Z' | ||
|
||
# setup | ||
cd repo | ||
git init | ||
git commit --allow-empty -m 'Initial commit' | ||
|
||
# set up a fake GitHub remote | ||
shamhub init | ||
shamhub new origin alice/example.git | ||
shamhub register alice | ||
git push origin main | ||
|
||
env SHAMHUB_USERNAME=alice | ||
gs auth login | ||
|
||
git add feature.txt | ||
gs bc feature -m 'Add feature' | ||
|
||
env GIT_EDITOR= EDITOR= | ||
! with-term $WORK/input/prompt.txt -- gs branch submit | ||
stdout 'Please configure a Git core.editor, or set the EDITOR environment variable.' | ||
|
||
-- repo/feature.txt -- | ||
Contents of feature | ||
|
||
-- input/prompt.txt -- | ||
await Title: | ||
feed \r | ||
await Body: | ||
snapshot init | ||
feed e | ||
await Please configure | ||
snapshot err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters