diff options
author | Guido Günther <agx@sigxcpu.org> | 2010-07-02 19:56:01 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-07-04 16:53:29 +0200 |
commit | 5f18c992267be81d7184314d19380717f2b7b168 (patch) | |
tree | 482106bc061292fc12eee9f335a46008aba32609 /gbp/git.py | |
parent | 6e9f3874a5f4a2549045dda0146c0263d258b631 (diff) | |
download | git-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.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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() |