Re: [PATCH 4/9] Discard "deleted" cache entries after using them to update the working tree

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

 



Hi,

On Mon, 4 Feb 2008, Daniel Barkalow wrote:

> Way back in read-tree.c, we used a mode 0 cache entry to indicate that 
> an entry had been deleted, so that the update code would remove the 
> working tree file, and we would just skip it when writing out the index 
> file afterward.
> 
> These days, unpack_trees is a library function, and it is still leaving 
> these entries in the active cache. Furthermore, unpack_trees doesn't 
> correctly ignore those entries, and who knows what other code wouldn't 
> expect them to be there, but just isn't yet called after a call to 
> unpack_trees. To avoid having other code trip over these entries, have 
> check_updates() remove them after it removes the working tree files.
> 
> While we're at it, make the loop more obvious and skip passing in 
> globals to a static function with only one caller.

After reading the code I understand what you mean.  How about

	While at it, make the loop removing those entries more obvious, 
	and avoid passing global variables as parameters to 
	check_updates(): there is only one call site anyway.

Ciao,
Dscho

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

  Powered by Linux