Re: [PATCH] git stash: Give friendlier error when there is nothing to apply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ori Avtalion wrote:
>  apply_stash () {
> +	have_stash || die 'Nothing to apply'
> +
>  	git update-index -q --refresh &&
>  	git diff-files --quiet --ignore-submodules ||
>  		die 'Cannot apply to a dirty working tree, please stage your changes'
> 

This needs a guard against the case where the user says

  git stash apply $some_sha1

but his refs/stash is empty.  This could be the case, e.g., after
mistakenly blowing away the reflog with 'git stash clear' and then
going on a recovery hunt through the unreferenced commits.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]