Re: [PATCH 16/19] reset [--mixed] --quiet: don't refresh index

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

 



Martin von Zweigbergk <martinvonz@xxxxxxxxx> writes:

> There is a test case in t7102 called '--mixed refreshes the index',
> but it only checks that right output it printed.

I think that comes from 620a6cd (builtin-reset: avoid forking
"update-index --refresh", 2007-11-03).  Before that commit, we
refreshed the index with --mixed, and the test tries to make sure we
continue to do so after the change.  Even though it is not testing
if the index has stat only changes (which is rather cumbersome to
write---you need to futz with timestamp or something) and using the
output from refresh machinery as a substitute, I think the intent of
that commit is fairly clear.

>  builtin/reset.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 9bcad29..a2e69eb 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -109,12 +109,6 @@ static void print_new_head_line(struct commit *commit)
>  		printf("\n");
>  }
>  
> -static void update_index_refresh(int flags)
> -{
> -	refresh_index(&the_index, (flags), NULL, NULL,
> -		      _("Unstaged changes after reset:"));
> -}
> -
>  static void update_index_from_diff(struct diff_queue_struct *q,
>  		struct diff_options *opt, void *data)
>  {
> @@ -328,9 +322,9 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
>  				die(_("Could not reset index file to revision '%s'."), rev);
>  		}
>  
> -		if (reset_type == MIXED) /* Report what has not been updated. */
> -			update_index_refresh(
> -				quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
> +		if (reset_type == MIXED && !quiet) /* Report what has not been updated. */
> +			refresh_index(&the_index, REFRESH_IN_PORCELAIN, NULL, NULL,
> +				      _("Unstaged changes after reset:"));
>  
>  		if (write_cache(newfd, active_cache, active_nr) ||
>  		    commit_locked_index(lock))
--
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]