summaryrefslogtreecommitdiff
path: root/gbp/git.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-07-02 19:56:01 +0200
committerGuido Günther <agx@sigxcpu.org>2010-07-04 16:53:29 +0200
commit5f18c992267be81d7184314d19380717f2b7b168 (patch)
tree482106bc061292fc12eee9f335a46008aba32609 /gbp/git.py
parent6e9f3874a5f4a2549045dda0146c0263d258b631 (diff)
downloadgit-buildpackage-5f18c992267be81d7184314d19380717f2b7b168.tar.gz
git-buildpackage-5f18c992267be81d7184314d19380717f2b7b168.tar.bz2
git-buildpackage-5f18c992267be81d7184314d19380717f2b7b168.zip
Allow git_write_tree to use an alternate index file
Git-Dch: Ignore
Diffstat (limited to 'gbp/git.py')
-rw-r--r--gbp/git.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 7d03e287..15b2a51d 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -212,9 +212,14 @@ class GitRepository(object):
raise GitRepositoryError, "can't find SHA1 for %s" % name
return sha[0].strip()
- def write_tree(self):
+ def write_tree(self, index=None):
"""write out the current index, return the SHA1"""
- tree, ret = self.__git_getoutput('write-tree')
+ if index:
+ extra_env = {'GIT_INDEX_FILE': index }
+ else:
+ extra_env = None
+
+ tree, ret = self.__git_getoutput('write-tree', extra_env=extra_env)
if ret:
raise GitRepositoryError, "can't write out current index"
return tree[0].strip()