feature: support to use relative path as submodule's url when adding new submodule (#1339)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-21 00:10:10 +08:00
parent ece51fbd32
commit 438aa76695
No known key found for this signature in database
3 changed files with 28 additions and 14 deletions

View file

@ -50,7 +50,11 @@ namespace SourceGit.Models
return true;
}
return url.EndsWith(".git", StringComparison.Ordinal) && Directory.Exists(url);
var localPath = url;
if (url.StartsWith("file://", StringComparison.Ordinal))
localPath = url.Substring(7);
return Directory.Exists(localPath);
}
public bool TryGetVisitURL(out string url)