Re: bug: git submodule add fails when .git is a symlink
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 1, 2016, 21:50 UTC
- Message-ID
- <xmqq8u217tqa.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kY6Lf6u0=s8J_cqRNFsry4nu2SdL0GZ2gkFsu6gBrB65Q@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 12 quoted lines
> On Tue, Mar 1, 2016 at 12:42 PM, Joey Hess <id@joeyh.name> wrote: >> git init gitdir >> mkdir worktree >> cd worktree >> ln -s ../gitdir/.git .git >> git submodule add /any/git/repo sub >> >> fatal: Could not chdir to '../../../sub': No such file or directory >> >> Fairly sure this is a bug.. > > Which version(s) of Git do you use?
A more pertinent question may be which version of Git did the above ever work, I guess. We fairly liberally chdir around and I do not think we deliberately avoid assuming that "cd .git && cd .." might not come back to the original directory, for example, so I wouldn't be surprised if it never worked.