Guard a test against wc that pads its output with whitespace
[gitweb.git] / gitMergeCommon.py
index 7e8855c617ac3391a698e61023d9ca465b4b295e..ff6f58a07c8f46563d34876a70449d79d527300c 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Copyright (C) 2005 Fredrik Kuivinen
+#
+
 import sys, re, os, traceback
 from sets import Set
 
@@ -213,7 +217,7 @@ def buildGraph(heads):
 
 # Write the empty tree to the object database and return its SHA1
 def writeEmptyTree():
-    tmpIndex = os.environ['GIT_DIR'] + '/merge-tmp-index'
+    tmpIndex = os.environ.get('GIT_DIR', '.git') + '/merge-tmp-index'
     def delTmpIndex():
         try:
             os.unlink(tmpIndex)