I didn't dive into your code yet, but it looks like here could be used https://github.com/gitextensions/gitextensions/blob/master/GitCommands/AsyncLoader.cs