merge: candidate codegraph check-ignore fixup into local_dev
This commit is contained in:
@@ -26,3 +26,4 @@ policy_revision: codegraph-governance-2026-09-24-r1
|
||||
- unittest(scripts/tests)+ 针对性正负例
|
||||
- 真实命令:cleanup report / docs drift / hooks codegraph-sync
|
||||
- 测试报告:`.doc/test-reports/2026-09-24-codegraph-governance-test-report.md`(工程规范变更,PI/全量 Go 标 NOT REQUIRED)
|
||||
- fixup landed note: trailing-slash check-ignore
|
||||
|
||||
@@ -39,7 +39,7 @@ def maybe_codegraph_init(path, *, timeout=180):
|
||||
return {'status': 'not_installed'}
|
||||
target = Path(path).resolve()
|
||||
ignored = subprocess.run(
|
||||
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph'],
|
||||
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph/'],
|
||||
capture_output=True, check=False).returncode == 0
|
||||
if not ignored:
|
||||
print(json.dumps({
|
||||
|
||||
+2
-1
@@ -755,8 +755,9 @@ def codegraph_is_ignored(path):
|
||||
"""True when git will not track .codegraph under path (safe to init)."""
|
||||
target = Path(path).resolve()
|
||||
try:
|
||||
# Pattern `.codegraph/` only matches directories; probe with trailing slash.
|
||||
completed = subprocess.run(
|
||||
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph'],
|
||||
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph/'],
|
||||
capture_output=True, check=False)
|
||||
return completed.returncode == 0
|
||||
except OSError:
|
||||
|
||||
Reference in New Issue
Block a user