/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to gitlib/model.py

All tests are passing again

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""The model for interacting with the git process, etc."""
18
18
 
 
19
import os
19
20
import subprocess
20
21
 
21
22
from bzrlib.plugins.git.gitlib import errors
28
29
        self.git_dir = git_dir
29
30
 
30
31
    def git_command(self, command, args):
31
 
        return ['git', '--git-dir', self.git_dir, command] + args
 
32
        return ['git', command] + args
32
33
 
33
34
    def git_lines(self, command, args):
34
35
        cmd = self.git_command(command, args)
 
36
        env = os.environ.copy()
 
37
        env['GIT_DIR'] = self.git_dir
35
38
        p = subprocess.Popen(cmd,
36
39
                             stdout=subprocess.PIPE,
37
 
                             stderr=subprocess.PIPE)
 
40
                             stderr=subprocess.PIPE,
 
41
                             env=env)
38
42
        lines = p.stdout.readlines()
39
43
        if p.wait() != 0:
40
44
            raise errors.GitCommandError(cmd, p.returncode,
70
74
 
71
75
    def rev_parse(self, git_id):
72
76
        args = ['--verify', git_id]
73
 
        return self.git_line('rev-parse', args)
 
77
        return self.git_line('rev-parse', args).strip()
74
78
 
75
79
    def get_head(self):
76
80
        try: