Skip to content

Commit 185a03d

Browse files
committed
Debugging
1 parent 5eb16e8 commit 185a03d

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/tooling/docs-builder/Cli/DiffCommands.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,10 @@ public async Task<int> ValidateRedirects([Argument] string? path = null, Cancel
5757
}
5858

5959
IRepositoryTracker tracker = runningOnCi ? new IntegrationGitRepositoryTracker(logFactory.CreateLogger<IntegrationGitRepositoryTracker>(), path) : new LocalGitRepositoryTracker(collector, root, path);
60-
_log.LogInformation("Calling GetChangedFiles");
61-
GitChange[] changed = [];
62-
try
63-
{
64-
changed = tracker.GetChangedFiles() as GitChange[] ?? [];
65-
}
66-
catch (Exception e)
67-
{
68-
_log.LogError(e, "Error while getting changed files");
69-
}
70-
71-
_log.LogInformation("Finished GetChangedFiles");
60+
var changed = tracker.GetChangedFiles();
7261

73-
if (changed.Length > 0)
74-
_log.LogInformation($"Found {changed.Length} changes to files related to documentation in the current branch.");
62+
if (changed.Any())
63+
_log.LogInformation($"Found {changed.Count()} changes to files related to documentation in the current branch.");
7564

7665
foreach (var notFound in changed.DistinctBy(c => c.FilePath).Where(c => c.ChangeType is GitChangeType.Deleted or GitChangeType.Renamed
7766
&& !redirects.ContainsKey(c is RenamedGitChange renamed ? renamed.OldFilePath : c.FilePath)))

0 commit comments

Comments
 (0)