Skip to content

Commit c2d77a6

Browse files
Use revlist
1 parent 8902330 commit c2d77a6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

completion.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ def get_completion(
4949
).completion
5050

5151
try:
52+
# Fetch commit from before 30 days ago and checkout
53+
commit = subprocess.check_output(
54+
['git', 'rev-list', '-n', '1', '--before="30 days ago"', 'HEAD'],
55+
cwd=clone_path,
56+
text=True
57+
).strip()
5258
subprocess.run(
53-
['git', 'checkout', 'HEAD@{30 days ago}'], cwd=clone_path, check=True
59+
['git', 'checkout', commit],
60+
cwd=clone_path,
61+
check=True
5462
)
5563
with TemporaryDirectory() as tmpdir2:
5664
month_ago_completion = potodo.merge_and_scan_path(

0 commit comments

Comments
 (0)