question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Submodule project nested in submodule gives "Unable to locate repository ..."

See original GitHub issue

So I have a docker build with all the required files, including

RUN echo "gitdir: ../.git/modules/Project" > Project/.git

Yet I’m getting the following warning /root/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): warning : Unable to locate repository containing directory 'Project/Project.csproj [Project/Project.csproj]'

Which finally ends in this error /usr/share/dotnet/sdk/2.2.203/Roslyn/Microsoft.Managed.Core.targets(90,5): error : SourceRoot items must include at least one top-level (not nested) item when DeterministicSourcePaths is true [Project/Project.csproj]

Has this support not been released yet?

P.S. I don’t quite get why this docker container build behaves so different from a local publish, they both have the full .git dir available.

EDIT: After doing some more digging libgit2sharp (which then bubbles up) seems to return null on the Repository.Discover call in our docker container, while outside it does work.

This is all with latest beta2, couldn’t get older version to work better at all

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
NinoFloriscommented, Dec 16, 2019

Sorry for the delay, I wasn’t on the affected project for a while.

I changed my repro from https://github.com/dotnet/sourcelink/issues/276#issuecomment-489463618 to affect the new situation. By changing version “1.0.0-beta2-18618-05” to “1.0.0” this warning doesn’t appear anymore!

/root/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build
/Microsoft.Build.Tasks.Git.targets(20,5): warning : Unable to locate repository containing 
directory '/root/repo/submodule/subdir'. [/root/repo/submodule/subdir/subdir.csproj]

Thanks so much!

0reactions
tmatcommented, Oct 8, 2019

@NinoFloris Is this still an issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - Cannot find repository from submodule
I realized the "/" behind the sub-repo-name.git in the url of the error message. This sounds similar to the last comment of @user467384....
Read more >
Relative submodule link to a nested project fails to resolve
Summary. A submodule with a relative link to a project in a nested group does not resolve correctly. Steps to reproduce.
Read more >
Git nested submodules not syncing
I've committed and deployed the main repo to Render, submodule 1 is synced up automatically by Render, but Nested Submodule 1 does not...
Read more >
How to Utilize Submodules within Git Repos
With this command Git will go into your submodules folder and fetch any updates for you, and if you want to fetch updates...
Read more >
Git - Submodules
Let's start by adding an existing Git repository as a submodule of the repository that we're working on. To add a new submodule...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found