Exemplo n.º 1
0
 def fetchRemote(self, branch, remote="origin"):
     self.readOnlyCheck()
     run("git -C %s remote set-branches --add %s %s" %
         (self.root, remote, branch),
         quiet=self.quiet)
     return run("git -C %s fetch %s refs/heads/%s:refs/remotes/%s/%s" %
                (self.root, remote, branch, remote, branch),
                quiet=self.quiet)
Exemplo n.º 2
0
 def fetchRemote(self, branch, remote="origin", options=None):
     options = options or []
     self.readOnlyCheck()
     opts = " ".join(options)
     run("git -C %s remote set-branches --add %s %s" %
         (self.root, remote, branch),
         quiet=self.quiet)
     return run("git -C %s fetch %s %s refs/heads/%s:refs/remotes/%s/%s" %
                (self.root, opts, remote, branch, remote, branch),
                quiet=self.quiet)
Exemplo n.º 3
0
 def checkout(self, branch="master", origin=None):
     if origin is not None:
         args = "%s %s" % (origin, branch)
     else:
         args = branch
     retval = run("git -C %s checkout %s" % (self.root, args),
                  quiet=self.quiet)
     return retval == 0
Exemplo n.º 4
0
 def clone(self, url, branch, depth=None):
     if depth is not None:
         depth_str = "--depth=%s" % depth
     else:
         depth_str = ""
     return run("git clone -b %s %s --single-branch %s %s" %
                (branch, depth_str, url, self.root),
                quiet=self.quiet)
Exemplo n.º 5
0
 def clean(self, options=None):
     options = options or []
     self.readOnlyCheck()
     opts = " ".join(options)
     return run("git -C %s clean %s" % (self.root, opts), quiet=self.quiet)
Exemplo n.º 6
0
 def localBranchExists(self, branch):
     return not run("git -C %s show-ref --verify --quiet refs/heads/%s" %
                    (self.root, branch),
                    quiet=self.quiet)
Exemplo n.º 7
0
 def shallowClone(self, url, branch, depth=1):
     return run("git clone -b %s --depth=%s --single-branch %s %s" %
                (branch, depth, url, self.root),
                quiet=self.quiet)