Allow using .git directory instead of gitdir redirect in submodules.#653
Allow using .git directory instead of gitdir redirect in submodules.#653tmat merged 6 commits intodotnet:mainfrom
Conversation
|
I think I've addressed your comments @tmat, could you take a look when you have a chance? |
|
@tmat I think @MichaelSimons is running into this in another case, could you take a look at the PR again? |
ff6a5d2 to
88e7e5e
Compare
|
|
||
| var gitDirectory = | ||
| Directory.Exists(dotGitPath) ? dotGitPath : | ||
| File.Exists(dotGitPath) ? ReadDotGitFile(dotGitPath) : |
There was a problem hiding this comment.
A test is failing - looking at it I think we should keep throwing if the file can't be read, rather then returning null.
var gitDirectory = Directory.Exists(dotGitPath) ? dotGitPath : ReadDotGitFile(dotGitPath);
if (!IsGitDirectory(gitDirectory, out var commonDirectory))
{
return null;
}There was a problem hiding this comment.
With this change you'd still need to update the Submodules_Errors test - remove case S6:
[submodule ""S6""] # sub6/.git is a directory, but should be a file
path = sub6
url = http://github.com
There was a problem hiding this comment.
Or rather update it - since in this case the directory is not a valid git directory (it's empty) so failure is expected of some sort
|
@crummel Committed a fix to the test. |
|
Thanks! Sorry about that, I got pulled away by some servicing work. |
…11) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [Microsoft.SourceLink.GitHub](https://togithub.com/dotnet/sourcelink) | `1.1.0` -> `1.1.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>dotnet/sourcelink (Microsoft.SourceLink.GitHub)</summary> ### [`v1.1.1`](https://togithub.com/dotnet/sourcelink/releases/tag/1.1.1) [Compare Source](https://togithub.com/dotnet/sourcelink/compare/1.1.0...1.1.1) #### Notable Changes - Feature: GitWeb Source Link provider by [@​Glen-Nicol-Garmin](https://togithub.com/Glen-Nicol-Garmin) in [https://github.com/dotnet/sourcelink/pull/505](https://togithub.com/dotnet/sourcelink/pull/505) - Use submodule.name.url to determine the URL of a submodule by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/587](https://togithub.com/dotnet/sourcelink/pull/587) - Add Microsoft.SourceLink.Tools source package implementing SourceLinkMap by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/663](https://togithub.com/dotnet/sourcelink/pull/663) - Added support for gitea by [@​Mik4sa](https://togithub.com/Mik4sa) in [https://github.com/dotnet/sourcelink/pull/674](https://togithub.com/dotnet/sourcelink/pull/674) - Enable source-build with Arcade SDK fixes by [@​dagood](https://togithub.com/dagood) in [https://github.com/dotnet/sourcelink/pull/692](https://togithub.com/dotnet/sourcelink/pull/692) - Add netstandard2.0 target to tools package by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/702](https://togithub.com/dotnet/sourcelink/pull/702) - Update license to MIT by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/730](https://togithub.com/dotnet/sourcelink/pull/730) - Allow using .git directory instead of gitdir redirect in submodules. by [@​crummel](https://togithub.com/crummel) in [https://github.com/dotnet/sourcelink/pull/653](https://togithub.com/dotnet/sourcelink/pull/653) - Fix discovery of working directory for worktrees by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/734](https://togithub.com/dotnet/sourcelink/pull/734) - Add support for the new GitLab raw url by [@​rgl](https://togithub.com/rgl) in [https://github.com/dotnet/sourcelink/pull/713](https://togithub.com/dotnet/sourcelink/pull/713) - Target netcoreapp3.1 by [@​tmat](https://togithub.com/tmat) in [https://github.com/dotnet/sourcelink/pull/767](https://togithub.com/dotnet/sourcelink/pull/767) #### New Contributors - [@​Glen-Nicol-Garmin](https://togithub.com/Glen-Nicol-Garmin) made their first contribution in [https://github.com/dotnet/sourcelink/pull/505](https://togithub.com/dotnet/sourcelink/pull/505) - [@​IgorKustov-ChathamFinancial](https://togithub.com/IgorKustov-ChathamFinancial) made their first contribution in [https://github.com/dotnet/sourcelink/pull/592](https://togithub.com/dotnet/sourcelink/pull/592) - [@​v-chmart](https://togithub.com/v-chmart) made their first contribution in [https://github.com/dotnet/sourcelink/pull/604](https://togithub.com/dotnet/sourcelink/pull/604) - [@​0xced](https://togithub.com/0xced) made their first contribution in [https://github.com/dotnet/sourcelink/pull/668](https://togithub.com/dotnet/sourcelink/pull/668) - [@​nycdotnet](https://togithub.com/nycdotnet) made their first contribution in [https://github.com/dotnet/sourcelink/pull/672](https://togithub.com/dotnet/sourcelink/pull/672) - [@​Mik4sa](https://togithub.com/Mik4sa) made their first contribution in [https://github.com/dotnet/sourcelink/pull/674](https://togithub.com/dotnet/sourcelink/pull/674) - [@​rgl](https://togithub.com/rgl) made their first contribution in [https://github.com/dotnet/sourcelink/pull/713](https://togithub.com/dotnet/sourcelink/pull/713) - [@​adiaaida](https://togithub.com/adiaaida) made their first contribution in [https://github.com/dotnet/sourcelink/pull/737](https://togithub.com/dotnet/sourcelink/pull/737) **Full Changelog**: dotnet/sourcelink@1.0.0...1.1.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apollographql/federation-hotchocolate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44LjEiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This is not a scenario for normal git repos, but is still legal, and the Arcade uberclone purposely uses this scenario for minimal SourceLink metadata.