]> git.ipfire.org Git - thirdparty/git.git/commit
stash: simplify reflog emptiness check
authorRené Scharfe <l.s.r@web.de>
Sat, 24 Oct 2020 17:06:48 +0000 (19:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 1 Nov 2020 23:51:31 +0000 (15:51 -0800)
commit4f44c5659bfb6e80fe76e68ec775859915d5f94a
treec9a17eecc5ad1272139f3e991b20a64547757d55
parent898f80736c75878acc02dc55672317fcc0e0a5a6
stash: simplify reflog emptiness check

Calling rev-parse to check if the drop subcommand removed the last stash
and treating its failure as confirmation is fragile, as the command can
fail for other reasons, e.g. because the system is out of memory.
Directly check if the reflog is empty instead, which is more robust.

Reported-by: Marek Mrva <mrva@eof-studios.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/stash.c