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 symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| _run | git_source.py | same file |
| RepoRef | git_source.py | same file |
| RepoSpecError | git_source.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| parse_repo_spec | git_source.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| git_source | git_source.py | same 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
