You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo inspect ends in a PermissionError traceback when a tracked file's directory in a git working tree is chmod 000 #906
Input: a git working tree with AGENTS.md and a committed sub/f.py, then chmod 000 sub.
python cli.py repo inspect <dir> exits 5 with PermissionError: [Errno 13] Permission denied: '.../repo/sub/f.py'. The traceback ends at dokimi/repos/source.py:141 in WorkTree.files, called from Scan.__post_init__ (dokimi/repos/l0/core.py:135). git ls-files lists sub/f.py from the index and Path.is_file() raises EACCES on it.
Expected: exit 0 and the report of the readable rest, 1 instruction files (1 root). A plain directory with the same chmod 000 sub exits 0.
A test is attached as tests/test_repo_inspect_unreadable_dir.py; it fails on aa7e8053. Wrapping the is_file() or is_symlink() test of source.py:141 in a helper that returns False on OSError makes it pass, and tests/test_repo_inspect_cli.py stays green.
tests/test_repo_inspect_unreadable_dir.py
# Copyright (C) 2026 Intel Corporation# SPDX-License-Identifier: Apache-2.0"""``repo inspect`` on a git working tree with a tracked file in a directory that cannot be searched."""from __future__ importannotationsimportosimportsubprocessimportsysfrompathlibimportPathimportpytestPROJECT=Path(__file__).resolve().parents[1]
@pytest.mark.skipif(os.name=="nt"or (hasattr(os, "geteuid") andos.geteuid() ==0),reason="needs a directory mode the user cannot bypass")deftest_inspect_survives_a_tracked_file_in_an_unreadable_directory(tmp_path):
root=tmp_path/"repo"
(root/"sub").mkdir(parents=True)
(root/"AGENTS.md").write_text("# Guide\n", encoding="utf-8")
(root/"sub"/"f.py").write_text("x = 1\n", encoding="utf-8")
forargvin (["init", "-q", "."], ["add", "-A"],
["-c", "user.email=t@t", "-c", "user.name=t", "commit", "-q", "-m", "init"]):
subprocess.run(["git", "-C", str(root), *argv], check=True)
(root/"sub").chmod(0o000)
try:
done=subprocess.run([sys.executable, "cli.py", "repo", "inspect", str(root)], cwd=PROJECT,
capture_output=True, text=True, timeout=120)
finally:
(root/"sub").chmod(0o755)
assert"Traceback"notindone.stderr, done.stderr[-600:]
assertdone.returncode==0, done.stderr[-600:]
assert"1 instruction files (1 root)"indone.stdout
Activity
docs(repo): say inspect leaves out a file below an unsearchable direc…