MCPcopy Create free account
hub / github.com/vispy/vispy / git_commit_id

Function git_commit_id

vispy/testing/image_tester.py:485–494  ·  view source on GitHub ↗

Return the commit id of *ref* in the git repository at *path*.

(path, ref)

Source from the content-addressed store, hash-verified

483
484
485def git_commit_id(path, ref):
486 """Return the commit id of *ref* in the git repository at *path*."""
487 cmd = git_cmd_base(path) + ['show', ref]
488 try:
489 output = run_subprocess(cmd, stderr=None, universal_newlines=True)[0]
490 except CalledProcessError:
491 raise NameError("Unknown git reference '%s'" % ref)
492 commit = output.split('\n')[0]
493 assert commit[:7] == 'commit '
494 return commit[7:]

Callers 1

get_test_data_repoFunction · 0.85

Calls 2

git_cmd_baseFunction · 0.85
run_subprocessFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…