mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: disable pull/stash/apply/git-flow/git-lfs buttons in bare
repository
This commit is contained in:
parent
b9b5220590
commit
a112d212dc
3 changed files with 12 additions and 6 deletions
|
@ -59,6 +59,12 @@ namespace SourceGit.Views
|
|||
var launcher = this.FindAncestorOfType<Launcher>();
|
||||
if (launcher is not null && DataContext is ViewModels.Repository repo)
|
||||
{
|
||||
if (repo.IsBare)
|
||||
{
|
||||
App.RaiseException(repo.FullPath, "Can't run `git pull` in bare repository!");
|
||||
return;
|
||||
}
|
||||
|
||||
var startDirectly = launcher.HasKeyModifier(KeyModifiers.Control);
|
||||
launcher.ClearKeyModifier();
|
||||
repo.Pull(startDirectly);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue