Пример #1
0
 def check_call(self, *args, **kargs):
     """ Call a git command """
     git_env = None
     if not kargs.get("no_env", False):
         git_env                  = os.environ.copy()
         git_env['GIT_WORK_TREE'] = self.worktree
         git_env['GIT_DIR']       = self.gitdir
     margs = [GIT]
     margs.extend([ x for x in args])
     cwd = kargs.get("cwd", self.worktree)
     return command.call(margs, cwd = cwd, env = git_env)
Пример #2
0
    def call(self, *args, **kargs):
        """ Call a git command, but do not throw if it fails

        """
        git_env = None
        if not kargs.get("no_env", False):
            git_env                  = os.environ.copy()
            git_env['GIT_WORK_TREE'] = self.worktree
            git_env['GIT_DIR']       = self.gitdir
        margs = [GIT]
        margs.extend([ x for x in args])
        cwd = kargs.get("cwd", self.worktree)
        return command.call(margs, cwd = cwd, env = git_env, ignore_ret_code=True)