diff --git a/NetRevisionTool/Program.cs b/NetRevisionTool/Program.cs index a090b11..97b47a3 100644 --- a/NetRevisionTool/Program.cs +++ b/NetRevisionTool/Program.cs @@ -313,6 +313,9 @@ private static void MainWrapper() /// 0 (trace message), 1 (success), 2 (warning), 3 (error), 4 (raw output). public static void ShowDebugMessage(string text, int severity = 0) { + if (text == null) + return; + if (showDebugOutput) { var color = Console.ForegroundColor; diff --git a/NetRevisionTool/VcsProviders/GitProvider.cs b/NetRevisionTool/VcsProviders/GitProvider.cs index 3ba34cb..eff45c8 100644 --- a/NetRevisionTool/VcsProviders/GitProvider.cs +++ b/NetRevisionTool/VcsProviders/GitProvider.cs @@ -9,7 +9,10 @@ namespace NetRevisionTool.VcsProviders { - internal class GitProvider : IVcsProvider + /// + /// Git specific. + /// + internal class GitProvider : IVcsProvider { #region Private data @@ -140,13 +143,20 @@ public RevisionData ProcessDirectory(string path) line = null; while (!p.StandardOutput.EndOfStream) { - line = p.StandardOutput.ReadLine(); + string templine = p.StandardOutput.ReadLine(); + + // Do not consider this line if it contans any of the file names that can, conceivably appear in the status due to the tool itself. + + if (!(templine.Contains("AssemblyInfo.cs") || templine.Contains("AssemblyInfo.vb") || templine.Contains("AssemblyInfo.bak"))) + line = templine; + Program.ShowDebugMessage(line, 4); } if (!p.WaitForExit(1000)) { p.Kill(); } + data.IsModified = !string.IsNullOrEmpty(line); // Query the current branch diff --git a/README.md b/README.md index 521d338..c34a92d 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ By automating the copying of that revision ID into the application source code, ## Licence and terms of use This software is released under the terms of the GNU GPL licence, version 3. You can find the detailed terms and conditions in the download or on the [GNU website](http://www.gnu.org/licenses/gpl-3.0.html). + +This is a work in progress