X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=gitMergeCommon.py;h=fdbf9e4778fd7d44667e475ba659d64986b2e097;hb=fd7e9fb7ae206a64b87c7faecfc88716e98a7577;hp=7e8855c617ac3391a698e61023d9ca465b4b295e;hpb=343d35c9166cf1713eb2787c3506fd2663466262;p=git.git diff --git a/gitMergeCommon.py b/gitMergeCommon.py index 7e8855c6..fdbf9e47 100644 --- a/gitMergeCommon.py +++ b/gitMergeCommon.py @@ -1,3 +1,7 @@ +# +# Copyright (C) 2005 Fredrik Kuivinen +# + import sys, re, os, traceback from sets import Set @@ -103,7 +107,10 @@ def isSha(obj): return (type(obj) is str and bool(shaRE.match(obj))) or \ (type(obj) is int and obj >= 1) -class Commit: +class Commit(object): + __slots__ = ['parents', 'firstLineMsg', 'children', '_tree', 'sha', + 'virtual'] + def __init__(self, sha, parents, tree=None): self.parents = parents self.firstLineMsg = None @@ -213,7 +220,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)