diff --git a/GitCommands/Git/GitModule.cs b/GitCommands/Git/GitModule.cs index 8d03a51ee7b..e68194ffebd 100644 --- a/GitCommands/Git/GitModule.cs +++ b/GitCommands/Git/GitModule.cs @@ -2162,9 +2162,10 @@ public IReadOnlyList GetInteractiveRebasePatchFiles() bool isCurrentFound = false; RevisionReader reader = new(this, hasReflogSelector: false, allBodies: true); - CancellationTokenSource cts = new(TimeSpan.FromSeconds(30)); Dictionary rebasedCommitsRevisions; - + try + { + using CancellationTokenSource cts = new(TimeSpan.FromSeconds(30)); try { rebasedCommitsRevisions = reader.GetRevisionsFromRange(todoCommitsInfos[0][1], todoCommitsInfos[^1][1], cts.Token)