Re: [PATCH v2 3/3] untracked-cache: write index when populating empty untracked cache

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

 



"Tao Klerks via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> diff --git a/dir.c b/dir.c
> index d91295f2bcd..4eee45dec91 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -2781,7 +2781,8 @@ void remove_untracked_cache(struct index_state *istate)
>  
>  static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *dir,
>  						      int base_len,
> -						      const struct pathspec *pathspec)
> +						      const struct pathspec *pathspec,
> +						      struct index_state *istate)
>  {
>  	struct untracked_cache_dir *root;
>  	static int untracked_cache_disabled = -1;
> @@ -2845,8 +2846,11 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d
>  		return NULL;
>  	}
>  
> -	if (!dir->untracked->root)
> +	if (!dir->untracked->root) {
> +		/* Untracked cache existed but is not initialized; fix that */
>  		FLEX_ALLOC_STR(dir->untracked->root, name, "");
> +		istate->cache_changed |= UNTRACKED_CHANGED;
> +	}
>  
>  	/* Validate $GIT_DIR/info/exclude and core.excludesfile */
>  	root = dir->untracked->root;
> @@ -2916,7 +2920,7 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
>  		return dir->nr;
>  	}
>  
> -	untracked = validate_untracked_cache(dir, len, pathspec);
> +	untracked = validate_untracked_cache(dir, len, pathspec, istate);
>  	if (!untracked)
>  		/*
>  		 * make sure untracked cache code path is disabled,

Makes sense.  Will queue.  Thanks.



[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