lab mr create: Check file exists (-F/-f options) #743
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when the file specified with the -F or -f options does not
exist, lab outputs a very generic error that is not helpful to users
[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create
2021/09/22 07:14:40 ERROR: mr_create.go:289: empty MR message
Check to see if the file exists and report a better error if the file is
not present. For example,
[prarit@prarit kernel-test]$ ~/git-kernel/github/lab/lab mr create -F /tmp/non-existent.file
2021/09/22 07:15:02 ERROR: mr_create.go:244: file /tmp/non-existent.file cannot be found
Fixes #742
Signed-off-by: Prarit Bhargava prarit@redhat.com