summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-08-02 06:11:15 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2010-08-02 06:11:15 -0700
commite74e07e8b9f85816ec34b4e00b8b7925dcec5318 (patch)
treece843919fe96fcca1488d91a11ebb5d2d345fb34
parent0837462f33bbd85f2da1abd33b9650e540983f97 (diff)
downloadDotNetOpenAuth-e74e07e8b9f85816ec34b4e00b8b7925dcec5318.zip
DotNetOpenAuth-e74e07e8b9f85816ec34b4e00b8b7925dcec5318.tar.gz
DotNetOpenAuth-e74e07e8b9f85816ec34b4e00b8b7925dcec5318.tar.bz2
Fixed NullReferenceException generated from latest git.exe under TeamCity.
-rw-r--r--lib/DotNetOpenAuth.BuildTasks.dllbin101376 -> 101376 bytes
-rw-r--r--lib/DotNetOpenAuth.BuildTasks.pdbbin245248 -> 245248 bytes
-rw-r--r--src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs14
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/DotNetOpenAuth.BuildTasks.dll b/lib/DotNetOpenAuth.BuildTasks.dll
index 48f4c6c..27631d5 100644
--- a/lib/DotNetOpenAuth.BuildTasks.dll
+++ b/lib/DotNetOpenAuth.BuildTasks.dll
Binary files differ
diff --git a/lib/DotNetOpenAuth.BuildTasks.pdb b/lib/DotNetOpenAuth.BuildTasks.pdb
index 9c5e9f6..b01adda 100644
--- a/lib/DotNetOpenAuth.BuildTasks.pdb
+++ b/lib/DotNetOpenAuth.BuildTasks.pdb
Binary files differ
diff --git a/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs b/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
index dfb3468..9818885 100644
--- a/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
+++ b/src/DotNetOpenAuth.BuildTasks/GetBuildVersion.cs
@@ -72,12 +72,13 @@ namespace DotNetOpenAuth.BuildTasks {
// First try asking Git for the HEAD commit id
try {
string cmdPath = Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
- ProcessStartInfo psi = new ProcessStartInfo(cmdPath, "/c git rev-parse HEAD");
- psi.WindowStyle = ProcessWindowStyle.Hidden;
- psi.CreateNoWindow = true;
- psi.RedirectStandardOutput = true;
- psi.UseShellExecute = false;
- Process git = Process.Start(psi);
+ var psi = new ProcessStartInfo(cmdPath, "/c git rev-parse HEAD") {
+ WindowStyle = ProcessWindowStyle.Hidden,
+ CreateNoWindow = true,
+ RedirectStandardOutput = true,
+ UseShellExecute = false
+ };
+ var git = Process.Start(psi);
commitId = git.StandardOutput.ReadLine();
git.WaitForExit();
if (git.ExitCode != 0) {
@@ -115,6 +116,7 @@ namespace DotNetOpenAuth.BuildTasks {
} catch (DirectoryNotFoundException) {
}
+ commitId = commitId ?? String.Empty; // doubly-be sure it's not null, since in some error cases it can be.
return commitId.Trim();
}