Skip to content

Commit

Permalink
Auto commit: 2024-12-05 21:46:01
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwood168 committed Dec 5, 2024
1 parent dff3c33 commit e53811b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/auto_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ def run_git_command(self, command: list) -> tuple[int, str, str]:
def has_changes(self) -> bool:
"""Проверяет наличие изменений в репозитории."""
returncode, stdout, _ = self.run_git_command(['git', 'diff', 'dev'])
return bool(stdout.strip())
if not stdout.strip():
return False

# Get list of changed files
_, status_out, _ = self.run_git_command(['git', 'status', '--porcelain'])
changed_files = [line[3:].strip() for line in status_out.split('\n') if line.strip()]

# Check if all changed files should be excluded
all_excluded = all(self.should_exclude_file(file) for file in changed_files)

return not all_excluded

def commit_changes(self) -> bool:
"""Создает коммит с текущими изменениями."""
Expand Down

0 comments on commit e53811b

Please sign in to comment.