MCPcopy Create free account
hub / github.com/modelscope/modelscope / get_remote_branches

Method get_remote_branches

modelscope/hub/git.py:173–180  ·  view source on GitHub ↗
(self, repo_dir: str)

Source from the content-addressed store, hash-verified

171 revision)
172
173 def get_remote_branches(self, repo_dir: str) -> List[str]:
174 rsp = self._run_git_command('-C', repo_dir, 'branch', '-r')
175 info = [
176 line.strip() for line in rsp.stdout.strip().splitlines() if line
177 ]
178 if len(info) <= 1:
179 return ['/'.join(info[0].split('/')[1:])] if info else []
180 return ['/'.join(line.split('/')[1:]) for line in info[1:]]
181
182 def get_repo_remote_url(self, repo_dir: str) -> str:
183 rsp = self._run_git_command('-C', repo_dir, 'config', '--get',

Callers

nothing calls this directly

Calls 1

_run_git_commandMethod · 0.95

Tested by

no test coverage detected