Skip to content

Commit e47b069

Browse files
author
Andrew
committed
fixed log from writing temp files
1 parent d750acf commit e47b069

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

GitItGUI.Core/ChangesManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,10 @@ public static bool ResolveConflict(FileState fileState, bool refresh)
437437
}
438438

439439
// save local temp files
440+
Debug.pauseGitCommanderStdWrites = true;
440441
if (!Repository.SaveConflictedFile(fileState.filename, FileConflictSources.Ours, out fullPathOurs)) throw new Exception(Repository.lastError);
441442
if (!Repository.SaveConflictedFile(fileState.filename, FileConflictSources.Theirs, out fullPathTheirs)) throw new Exception(Repository.lastError);
443+
Debug.pauseGitCommanderStdWrites = false;
442444
fullPathOurs = Repository.repoPath + Path.DirectorySeparatorChar + fullPathOurs;
443445
fullPathTheirs = Repository.repoPath + Path.DirectorySeparatorChar + fullPathTheirs;
444446

@@ -598,6 +600,7 @@ public static bool ResolveConflict(FileState fileState, bool refresh)
598600
}
599601
catch (Exception e)
600602
{
603+
Debug.pauseGitCommanderStdWrites = false;
601604
Debug.LogError("Failed to resolve file: " + e.Message, true);
602605
DeleteTempMergeFiles();
603606
return false;
@@ -629,7 +632,9 @@ public static bool OpenDiffTool(FileState fileState)
629632
}
630633

631634
// get info and save orig file
635+
Debug.pauseGitCommanderStdWrites = true;
632636
if (!Repository.SaveOriginalFile(fileState.filename, out fullPathOrig)) throw new Exception(Repository.lastError);
637+
Debug.pauseGitCommanderStdWrites = false;
633638
fullPathOrig = Repository.repoPath + Path.DirectorySeparatorChar + fullPathOrig;
634639

635640
// open diff tool
@@ -650,6 +655,7 @@ public static bool OpenDiffTool(FileState fileState)
650655
}
651656
catch (Exception ex)
652657
{
658+
Debug.pauseGitCommanderStdWrites = false;
653659
Debug.LogError("Failed to start Diff tool: " + ex.Message, true);
654660
DeleteTempDiffFiles();
655661
return false;

GitItGUI.Core/Tools/Debug.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static class Debug
2020

2121
private static Stream stream;
2222
private static StreamWriter writer;
23+
public static bool pauseGitCommanderStdWrites;
2324

2425
static Debug()
2526
{
@@ -49,7 +50,7 @@ private static void Tools_RunExeDebugLineCallback(string line)
4950

5051
private static void Tools_StdCallback(string line)
5152
{
52-
Log(line);
53+
if (!pauseGitCommanderStdWrites) Log(line);
5354
}
5455

5556
private static void Tools_StdWarningCallback(string line)

0 commit comments

Comments
 (0)