fix(gov): probe .codegraph/ with trailing slash for check-ignore
This commit is contained in:
@@ -39,7 +39,7 @@ def maybe_codegraph_init(path, *, timeout=180):
|
|||||||
return {'status': 'not_installed'}
|
return {'status': 'not_installed'}
|
||||||
target = Path(path).resolve()
|
target = Path(path).resolve()
|
||||||
ignored = subprocess.run(
|
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
|
capture_output=True, check=False).returncode == 0
|
||||||
if not ignored:
|
if not ignored:
|
||||||
print(json.dumps({
|
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)."""
|
"""True when git will not track .codegraph under path (safe to init)."""
|
||||||
target = Path(path).resolve()
|
target = Path(path).resolve()
|
||||||
try:
|
try:
|
||||||
|
# Pattern `.codegraph/` only matches directories; probe with trailing slash.
|
||||||
completed = subprocess.run(
|
completed = subprocess.run(
|
||||||
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph'],
|
['git', '-C', str(target), 'check-ignore', '-q', '--', '.codegraph/'],
|
||||||
capture_output=True, check=False)
|
capture_output=True, check=False)
|
||||||
return completed.returncode == 0
|
return completed.returncode == 0
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|||||||
Reference in New Issue
Block a user