Keith Smiley <keithbsmi...@gmail.com> writes:

> In the case there are no files to stash, but the user asked to stash, we
> should exit 1 since the stashing failed.
> ---

Sorry, but I fail to see why this is a good change.  Did you have
some script that wanted the exit code from "git stash" to indicate
if it had anything to stash and change the behaviour based on it?

Is it a big enough hassle to figure out if the "stash" command did
something yourself that justifies forcing existing scripts that rely
on "no-op is merely a normal exit" behaviour other people have
written in the past several years?

>  git-stash.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index 789ce2f41d4a3..ca362b1a31277 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -318,7 +318,7 @@ push_stash () {
>       if no_changes "$@"
>       then
>               say "$(gettext "No local changes to save")"
> -             exit 0
> +             exit 1
>       fi
>  
>       git reflog exists $ref_stash ||
>
> --
> https://github.com/git/git/pull/587

Reply via email to