Skip to content

Commit ad4ab1e

Browse files
thanks copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9a697c1 commit ad4ab1e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

script.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ def get_local_commit():
4545
else:
4646
print(f"Error getting local commit: {result.stderr}")
4747
return None
48-
except Exception as e:
49-
print(f"Exception getting local commit: {e}")
48+
except FileNotFoundError as e:
49+
print(f"File not found error: {e}. Ensure the 'git' executable and the repository path exist.")
50+
return None
51+
except PermissionError as e:
52+
print(f"Permission error: {e}. Check your access rights to the repository path.")
53+
return None
54+
except subprocess.SubprocessError as e:
55+
print(f"Subprocess error: {e}. An issue occurred while running the 'git' command.")
5056
return None
5157

5258

0 commit comments

Comments
 (0)