mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04: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
|
@ -18,6 +18,11 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
public class Repository : ObservableObject, Models.IRepository
|
||||
{
|
||||
public bool IsBare
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string FullPath
|
||||
{
|
||||
get => _fullpath;
|
||||
|
@ -448,6 +453,13 @@ namespace SourceGit.ViewModels
|
|||
private set => SetProperty(ref _isAutoFetching, value);
|
||||
}
|
||||
|
||||
public Repository(bool isBare, string path, string gitDir)
|
||||
{
|
||||
IsBare = isBare;
|
||||
FullPath = path;
|
||||
GitDir = gitDir;
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
var settingsFile = Path.Combine(_gitDir, "sourcegit.settings");
|
||||
|
@ -995,6 +1007,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void RefreshWorkingCopyChanges()
|
||||
{
|
||||
if (IsBare)
|
||||
return;
|
||||
|
||||
var changes = new Commands.QueryLocalChanges(_fullpath, _settings.IncludeUntrackedInLocalChanges).Result();
|
||||
if (_workingCopy == null)
|
||||
return;
|
||||
|
@ -1010,6 +1025,9 @@ namespace SourceGit.ViewModels
|
|||
|
||||
public void RefreshStashes()
|
||||
{
|
||||
if (IsBare)
|
||||
return;
|
||||
|
||||
var stashes = new Commands.QueryStashes(_fullpath).Result();
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue