fix(devgen): handle missing git binary gracefully
Ensure the function returns an empty list when git is not found, avoiding crashes.
This commit is contained in:
1 file changed
+1
-1
+1
-1
@@ -199,7 +199,7 @@ def get_git_staged_files() -> list[str]:
|
|||||||
try:
|
try:
|
||||||
output = run_git_command(["git", "diff", "--name-only", "--cached"])
|
output = run_git_command(["git", "diff", "--name-only", "--cached"])
|
||||||
return [f for f in output.splitlines() if f.strip()]
|
return [f for f in output.splitlines() if f.strip()]
|
||||||
except subprocess.CalledProcessError:
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user