BF: clone: Account for relative paths when inheriting local origins #4045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
As of 367454e (NF: Auto-configure local origin of local origin to
make annex available, 2019-12-29), we check whether origin's URL for a
newly cloned annex dataset points to a local dataset. If it does, we
add that dataset's origin (if any) to the newly cloned dataset. And
as of d2a25d0 (ENH: Make configuration of local origin siblings work
recursively, 2020-01-05), we continue walking up the chain of local
origin's until we hit an origin that is not a local path.
However, we create the corresponding dataset instance with the wrong
path when origin is a relative path: it should be relative to the
cloned repository, not the current working directory. The incorrect
path means that there's no "origin of origin" to find, and an
"origin-N" remote isn't added.
Note that this bug isn't currently very accessible because
git clone
converts relative paths to absolute ones, and the first attempt to
adjust these back to relative paths (02e2b4c and 0a80bb4) was
reverted in e8c5d70 (BF: clone: Revert incorrect relative path
adjustment to URLs, 2020-01-14). But relative paths will be a common
case when the second attempt from gh-4026 lands.