Re: [PATCH resend] git-apply: apply submodule changes
- From
- Sven Verdoolaege <skimo@liacs.nl>
- Date
- Aug 11, 2007, 06:45 UTC
- Message-ID
- <20070811064555.GC29996@liacs.nl>
- In-Reply-To
- <7vd4xupqwh.fsf@assigned-by-dhcp.cox.net>
On Fri, Aug 10, 2007 at 10:43:42PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Sven Verdoolaege <skimo@kotnet.org> 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