Re: [PATCH v3 7/7] merge: do not exit restore_state() prematurely

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

 



"Elijah Newren via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> @@ -386,11 +386,11 @@ static void restore_state(const struct object_id *head,
>  	const char *args[] = { "stash", "apply", "--index", "--quiet",
>  			       NULL, NULL };
>  
> -	if (is_null_oid(stash))
> -		return;
> -
>  	reset_hard(head, 1);
>  
> +	if (is_null_oid(stash))
> +		goto refresh_cache;
> +

OK, so the idea is that we can call restore_state() without having
anything worth "restoring" in the stash, and what it means is that
we are restoring to HEAD.  As the current state does not necessarily
match HEAD, we should do the "reset --hard" part even if there was
nothing to stash.

Makes sense.




[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]

  Powered by Linux