Skip to content

Commit 8b5b17c

Browse files
fix: do not fail if the pre-push hook is a broken symlink
1 parent 9ac6afa commit 8b5b17c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ViewModels/Repository.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,15 @@ public Models.GitFlowBranchType GetGitFlowType(Models.Branch b)
641641
public bool IsLFSEnabled()
642642
{
643643
var path = Path.Combine(FullPath, ".git", "hooks", "pre-push");
644-
if (!File.Exists(path))
644+
try
645+
{
646+
var content = File.ReadAllText(path);
647+
return content.Contains("git lfs pre-push");
648+
}
649+
catch
650+
{
645651
return false;
646-
647-
var content = File.ReadAllText(path);
648-
return content.Contains("git lfs pre-push");
652+
}
649653
}
650654

651655
public async Task InstallLFSAsync()

0 commit comments

Comments
 (0)