@@ -26,8 +26,13 @@ public static string LocateRepository(string directory)
26
26
return Repository . Discover ( directory ) ;
27
27
}
28
28
29
+ internal static IRepository CreateRepository ( string root )
30
+ => new Repository ( root ) ;
31
+
29
32
public static string GetRepositoryUrl ( IRepository repository , Action < string , object [ ] > logWarning = null , string remoteName = null )
30
33
{
34
+ // GetVariableValue("remote", name, "url");
35
+
31
36
var remotes = repository . Network . Remotes ;
32
37
var remote = string . IsNullOrEmpty ( remoteName ) ? ( remotes [ "origin" ] ?? remotes . FirstOrDefault ( ) ) : remotes [ remoteName ] ;
33
38
if ( remote == null )
@@ -179,15 +184,6 @@ public static ITaskItem[] GetSourceRoots(IRepository repository, Action<string,
179
184
}
180
185
181
186
// https://git-scm.com/docs/git-submodule
182
- // <repository> is the URL of the new submodule's origin repository. This may be either an absolute URL, or (if it begins with ./ or ../),
183
- // the location relative to the superproject's default remote repository (Please note that to specify a repository foo.git which is located
184
- // right next to a superproject bar.git, you'll have to use ../foo.git instead of ./foo.git - as one might expect when following the rules
185
- // for relative URLs -- because the evaluation of relative URLs in Git is identical to that of relative directories).
186
- //
187
- // The given URL is recorded into .gitmodules for use by subsequent users cloning the superproject.
188
- // If the URL is given relative to the superproject's repository, the presumption is the superproject and submodule repositories
189
- // will be kept together in the same relative location, and only the superproject's URL needs to be provided.git --
190
- // submodule will correctly locate the submodule using the relative URL in .gitmodules.
191
187
var submoduleUrl = NormalizeUrl ( submodule . Url , repoRoot ) ;
192
188
if ( submoduleUrl == null )
193
189
{
0 commit comments