mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature: bare
repository support
This commit is contained in:
parent
cc5f3ebfa5
commit
b9b5220590
6 changed files with 89 additions and 48 deletions
|
@ -280,19 +280,20 @@ namespace SourceGit.ViewModels
|
|||
return;
|
||||
}
|
||||
|
||||
var gitDir = new Commands.QueryGitDir(node.Id).Result();
|
||||
if (string.IsNullOrEmpty(gitDir))
|
||||
var isBare = new Commands.IsBareRepository(node.Id).Result();
|
||||
var gitDir = node.Id;
|
||||
if (!isBare)
|
||||
{
|
||||
var ctx = page == null ? ActivePage.Node.Id : page.Node.Id;
|
||||
App.RaiseException(ctx, "Given path is not a valid git repository!");
|
||||
return;
|
||||
gitDir = new Commands.QueryGitDir(node.Id).Result();
|
||||
if (string.IsNullOrEmpty(gitDir))
|
||||
{
|
||||
var ctx = page == null ? ActivePage.Node.Id : page.Node.Id;
|
||||
App.RaiseException(ctx, "Given path is not a valid git repository!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var repo = new Repository()
|
||||
{
|
||||
FullPath = node.Id,
|
||||
GitDir = gitDir,
|
||||
};
|
||||
var repo = new Repository(isBare, node.Id, gitDir);
|
||||
repo.Open();
|
||||
|
||||
if (page == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue