Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

_local_ref

codeintel.git_source._local_ref

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (3)
SymbolFileResolved by
_rungit_source.pysame file
RepoRefgit_source.pysame file
RepoSpecErrorgit_source.pysame file
Called by (1)
SymbolFileResolved by
parse_repo_specgit_source.pysame file
Inside (1)
SymbolFileResolved by
git_sourcegit_source.pysame file
codeintel.git_source._local_refbackend/app/codeintel/git_source.py, lines 205–221Open source
def _local_ref(spec: str) -> RepoRef:    raw = spec[len("file://"):] if spec.startswith("file://") else spec    path = Path(os.path.expanduser(raw)).resolve()    if not path.is_dir():        raise RepoSpecError(f"local repository {path} does not exist")    try:        out = _run(["git", "-C", str(path), "rev-parse", "--git-dir"], timeout=30)    except GitError as exc:        raise RepoSpecError(f"{path} is not a git repository") from exc    if not out.strip():        raise RepoSpecError(f"{path} is not a git repository")    return RepoRef(        canonical_url=path.as_uri(),        source_type="local",        name=path.name,        local_path=str(path),    )

What the index recorded

Signature
def _local_ref(spec: str) -> RepoRef:
File
backend/app/codeintel/git_source.py
Lines
205–221
Parser
python-ast
Git blob
6f88470169e4935929c5f865a974bd86da564c1a
Call sites
12 named, 3 resolved, 9 left unlinked

Read it on GitHub at this commit