Cloning a clone with (relative) submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Created <ssh_repo_addr> including a submodule that is specified (in .gitmodules) as a relative path
git clone <ssh_repo_addr> origClone
git clone clone testClone

What did you expect to happen? (Expected behavior)

I expected 'testClone' to be a valid clone of origClone.  However, because the submodules are specified as a relative path, this no longer works.

What happened instead? (Actual behavior)

fatal: repository '<local_path>' does not exist
fatal: clone of '<local_path_to_relative_submodule_director>' into submodule path '<local_path_to_submodule_in_testClone>' failed


What's different between what you expected and what actually happened?

See the error message above


Anything else you want to add:

The issue is that when a clone is made with submoodules that contain a relative path, the relative path is maintained verbatim.  What I believe _should_ happen is that when cloning with submodules, any submodule path should be replaced with a path relative to what is being cloned.  This would maintain the idea that the new clone reflects the first clone as the origin.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.39.3
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Thu Mar 14 14:20:09 EDT 2024 x86_64
compiler info: gnuc: 8.5
libc info: glibc: 2.28
$SHELL (typically, interactive shell): /bin/tcsh


[Enabled Hooks]





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux