Re: [PATCH] builtin-commit: Refresh cache after adding files.

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

 



Hi,

On Fri, 9 Nov 2007, Kristian H?gsberg wrote:

> On Fri, 2007-11-09 at 17:05 +0000, Johannes Schindelin wrote:
> 
> > On Fri, 9 Nov 2007, Kristian Høgsberg wrote:
> > 
> > > This fixes the race in the last test int t3700.
> > 
> > Well, it is not a race.  My fault.  I thought it was.
> > 
> > What you basically did was to make sure that the index is up-to-date 
> > after adding the files.  You might even want to say that in the commit 
> > message, and only then say that it fixes t3700, too.
> 
> OK, I guess what I was wondering was why write_cache() doesn't write out
> an up-to-date index.

write_cache() only writes the index, it does not update it.

> Do we need a call to refresh_cache() when we update the user cache but 
> commit an index created from read_tree+add_files?  I.e. after the 
> add_files_to_index() call on line 97?  The shell script doesn't do this, 
> it only runs update-index --refresh for the index that gets committed.

I think it would be sane to do so.

IIUC this basically means that "git add <file> && git commit" should do 
the same to the cache as "git commit <file>".

Thanks,
Dscho

[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