Skip to content

Commit

Permalink
Fix: Fixed crash that would occur when two paths were entered from th…
Browse files Browse the repository at this point in the history
…e command line (files-community#15640)
  • Loading branch information
hishitetsu authored Jun 21, 2024
1 parent f0fa595 commit 016afe0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Files.App/Utils/Git/GitHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ private set

try
{
return
Repository.IsValid(path)
? path
: GetGitRepositoryPath(PathNormalization.GetParentDir(path), root);
if (Repository.IsValid(path))
return path;
else
{
var parentDir = PathNormalization.GetParentDir(path);
if (parentDir == path)
return null;
else
return GetGitRepositoryPath(parentDir, root);
}
}
catch (Exception ex) when (ex is LibGit2SharpException or EncoderFallbackException)
{
Expand Down

0 comments on commit 016afe0

Please sign in to comment.