Re: [PATCH] get_sha1: support relative path "<obj>:<sth>" syntax
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 10, 2010, 19:34 UTC
- Message-ID
- <7veiatht1b.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1289407021-30287-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 13 quoted lines
> if (namelen < 3 ||
> name[2] != ':' ||
> - name[1] < '0' || '3' < name[1])
> + name[1] < '0' || '3' < name[1]) {
> cp = name + 1;
> + if (startup_info && cp[0] == '.' &&
> + (cp[1] == '/' || (cp[1] == '.' && cp[2] == '/'))) {
> + new_path = prefix_path(startup_info->prefix,
> + strlen(startup_info->prefix),
> + cp);
> + cp = new_path;
> + }
> + }What does this new codepath do when we know where the working tree is and we are outside of the working tree (e.g. we are looking at the index or a commit in a submodule from above the superproject)?
What should it do?