From 998316282550d022cd875057273c15e2128c9360 Mon Sep 17 00:00:00 2001 From: Philippe Miossec Date: Thu, 14 Sep 2023 13:46:59 +0200 Subject: [PATCH] fix cancellation token declaration Co-authored-by: Michael Seibt <36601201+mstv@users.noreply.github.com> --- GitCommands/Git/GitModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)