First of all: yes, I've checked this thread inside out - but my situation is different.

We have three modules here:

  • an application A
  • its base library B (a submodule of A)
  • a component C (a submodule of B)

When trying to do git clone --recursive https://url_of_A/, we get an error when git attempts to fetch C:

Cloning into 'path/of/C'...
[...]
Checking connectivity... done
fatal: reference is not a tree: 92405dd9027a2d55d9dd6f5b26494eee0009e297
Unable to checkout '92405dd9027a2d55d9dd6f5b26494eee0009e297' 
   in submodule path 'path/to/C'

But guess what, there's no error when we do git clone --recursive https://url_of_B/ - even though the revision to check out is clearly the same:

Cloning into 'path/of/C'...
Checking connectivity... done
Submodule path 'path/to/C': checked out '92405dd9027a2d55d9dd6f5b26494eee0009e297'

... even though remote pathes to C are the same!

What's even more puzzling: this behavior is observed at Windows 7/8 machines only (so far, at least). Windows Vista/XP machines somehow do the deep cloning with the same repositories without any glitches - and I really wonder how's THAT can be platform-dependent.


That's for the case, now the questions: 1) is there anyone with the same problem, and 2) what could be the workarounds? Note that all the components (A, B, and C) are not under our control, so 'switch to git-tree' and stuff like that just won't work, unfortunately.

有帮助吗?

解决方案

As a first (incomplete) answer, a lot of submodule corrections went between git 1.8.4 and 1.8.5.2:

C:\Users\VonC\prog\git\git>git log -Ssubmodule v1.8.4..v1.8.5.2

It is possible one of those patches enhances the robustness of the submodule feature.
For instance, the msysgit issue you mention (issue 99) could be solved with commit 4b054402833.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top