Skip to content

Commit

Permalink
Fix checking if current branch is outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek committed Oct 13, 2024
1 parent f307175 commit 832a213
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ private static async Task<bool> IsBranchOutdated(string repoPath, string sourceB
var match = Regex.Match(originDetectOutput, @"HEAD branch:\s*(\S+)");
if (match.Success)
{
return match.Groups[1].Value; // Return the branch name captured by the group
return match.Groups[1].Value?.Trim(); // Return the branch name captured by the group
}

return null;
}
static async Task<string?> GetCurrentBranchName(string repoPath)
{
var (_, originDetectOutput) = await ExecuteCommand(repoPath, "git", "rev-parse --abbrev-ref HEAD");
return originDetectOutput;
return originDetectOutput?.Trim();
}

public async Task<(bool, IReadOnlyList<string>)> PullRepository(string path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ public async void PullRepoChanges(object arg)
}
finally
{
record.IsPulling = false;
if (pulledWithSuccess)
{

Expand All @@ -605,7 +606,6 @@ public async void PullRepoChanges(object arg)
var messageBoxStandardWindow = MessageBoxManager.GetMessageBoxStandard("What's new", string.Join("\r\n", releaseNotes), icon: MsBox.Avalonia.Enums.Icon.Info, windowStartupLocation:WindowStartupLocation.CenterOwner);
await messageBoxStandardWindow.ShowAsync();
}
record.IsPulling = false;
}

}
Expand Down

0 comments on commit 832a213

Please sign in to comment.