Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b8f7453

Browse files
Fixes needed after merge
1 parent 4d426e9 commit b8f7453

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed

src/GitHub.Api/Git/RepositoryManager.cs

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public ITask UnlockFile(string file, bool force)
270270
public void UpdateGitLog()
271271
{
272272
var task = GitClient.Log();
273-
HookupHandlers(task);
273+
task = HookupHandlers(task, false, false);
274274
task.Then((success, logEntries) =>
275275
{
276276
if (success)
@@ -280,6 +280,19 @@ public void UpdateGitLog()
280280
}).Start();
281281
}
282282

283+
public void UpdateGitStatus()
284+
{
285+
var task = GitClient.Status();
286+
task = HookupHandlers(task, true, false);
287+
task.Then((success, status) =>
288+
{
289+
if (success)
290+
{
291+
GitStatusUpdated?.Invoke(status);
292+
}
293+
}).Start();
294+
}
295+
283296
private ITask<T> HookupHandlers<T>(ITask<T> task, bool isExclusive, bool filesystemChangesExpected)
284297
{
285298
return new ActionTask(CancellationToken.None, () => {
@@ -321,7 +334,7 @@ private ITask<T> HookupHandlers<T>(ITask<T> task, bool isExclusive, bool filesys
321334
public void UpdateLocks()
322335
{
323336
var task = GitClient.ListLocks(false);
324-
HookupHandlers(task);
337+
HookupHandlers(task, false, false);
325338
task.Then((success, locks) =>
326339
{
327340
if (success)
@@ -391,31 +404,6 @@ private void UpdateCurrentBranchAndRemote(string head)
391404
CurrentBranchUpdated?.Invoke(branch, remote);
392405
}
393406

394-
private ITask HookupHandlers(ITask task, bool disableWatcher = false)
395-
{
396-
task.OnStart += t => {
397-
Logger.Trace("Start " + task.Name);
398-
IsBusy = true;
399-
400-
if (disableWatcher)
401-
{
402-
watcher.Stop();
403-
}
404-
};
405-
406-
task.OnEnd += t => {
407-
if (disableWatcher)
408-
{
409-
watcher.Start();
410-
}
411-
412-
IsBusy = false;
413-
414-
Logger.Trace("Finish " + task.Name);
415-
};
416-
return task;
417-
}
418-
419407
private void WatcherOnRemoteBranchesChanged()
420408
{
421409
Logger.Trace("WatcherOnRemoteBranchesChanged");

0 commit comments

Comments
 (0)