Re: git-submodule path computation bug with recursive submodules
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Jul 5, 2012, 18:34 UTC
- Message-ID
- <4FF5DE30.6030100@web.de>
- In-Reply-To
- <CABURp0qtbSsiRX9sJ1F5WS3wtKq32hpV=3pGmM6Ysn=9Nvw_nQ@mail.gmail.com>
Am 05.07.2012 16:18, schrieb Phil Hord:
Show 13 quoted lines
> On Thu, Jul 5, 2012 at 8:09 AM, Bob Halley <halley@play-bow.org> wrote: >> The first level of submodule clones successfully, but submodule 'foo' >> contains submodule 'bar', and cloning it fails. > > It fails for me too, running zsh and stock Linux. > > Seems to originate here. > > Commit: 69c3051780d6cacfe242563296160634dc667a90: > Author: Jens Lehmann <Jens.Lehmann@web.de> > Date: Sun Mar 4 22:15:36 2012 +0100 > > submodules: refactor computation of relative gitdir path
Yup, thanks both for reporting and nailing that one down.
This diff fixes the problem for me and should be a portable way to avoid "pwd -P" or "cd -P", I'll cook up a patch with test for that:
diff --git a/git-submodule.sh b/git-submodule.sh index 5c61ae2..4a22555 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -150,8 +150,8 @@ module_clone() die "$(eval_gettext "Clone of '\$url' into submodule path '\$sm_ fi - a=$(cd "$gitdir" && pwd)/ - b=$(cd "$sm_path" && pwd)/ + a=$(cd_to_toplevel && cd "$gitdir" && pwd)/ + b=$(cd_to_toplevel && cd "$sm_path" && pwd)/ # normalize Windows-style absolute paths to POSIX-style absolute paths case $a in [a-zA-Z]:/*) a=/${a%%:*}${a#*:} ;; esac case $b in [a-zA-Z]:/*) b=/${b%%:*}${b#*:} ;; esac