Re: [PATCH resend] git-apply: apply submodule changes

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

 



On Fri, Aug 10, 2007 at 10:43:42PM -0700, Junio C Hamano wrote:
> Sven Verdoolaege <skimo@xxxxxxxxxx> writes:
> >  	else if (patch->old_name) {
> >  		size = xsize_t(st->st_size);
> >  		alloc = size + 8192;
> >  		buf = xmalloc(alloc);
> > -		if (read_old_data(st, patch->old_name, &buf, &alloc, &size))
> > +		if (S_ISGITLINK(patch->old_mode))
> > +			size = snprintf(buf, alloc,
> > +				"Subproject commit %s\n", sha1_to_hex(ce->sha1));
> > +		else if (read_old_data(st, patch->old_name, &buf, &alloc, &size))
> 
> Who guarantees that ce is given to apply_data() in this codepath?

Oops.  I guess it shows that I only tested it through git-rebase.
Would changing

		if (check_index) {

on line 2093 to

		if (check_index || S_ISGITLINK(patch->old_mode)) {

be acceptable?  Adding a conditional call to read_cache(), of course.
We're not going to be able to apply submodule patches without
an index, anyway.
Or should we just refuse to apply submodule patches if --index
has not been specified?

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