enhance: disable pull/stash/apply/git-flow/git-lfs buttons in bare repository

This commit is contained in:
leo 2025-01-13 20:41:03 +08:00
parent b9b5220590
commit a112d212dc
No known key found for this signature in database
3 changed files with 12 additions and 6 deletions

View file

@ -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);