Skip to content

Commit 40c5d37

Browse files
Catch exception when empty dir
1 parent c2d77a6 commit 40c5d37

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

completion.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ def get_completion(
5353
commit = subprocess.check_output(
5454
['git', 'rev-list', '-n', '1', '--before="30 days ago"', 'HEAD'],
5555
cwd=clone_path,
56-
text=True
56+
text=True,
5757
).strip()
58-
subprocess.run(
59-
['git', 'checkout', commit],
60-
cwd=clone_path,
61-
check=True
62-
)
58+
subprocess.run(['git', 'checkout', commit], cwd=clone_path, check=True)
6359
with TemporaryDirectory() as tmpdir2:
6460
month_ago_completion = potodo.merge_and_scan_path(
6561
clone_path,
@@ -68,7 +64,7 @@ def get_completion(
6864
hide_reserved=False,
6965
api_url='',
7066
).completion
71-
except FileNotFoundError:
67+
except Exception:
7268
print(f'{repo} is empty')
7369
month_ago_completion = 0.0
7470

0 commit comments

Comments
 (0)