Compare commits
1 Commits
5ca16ec33f
...
backup-202
| Author | SHA1 | Date | |
|---|---|---|---|
| ae7d7c50b7 |
@ -107,7 +107,7 @@ class GitUtils:
|
||||
return result['success']
|
||||
|
||||
def add_files(self, files: List[str] = None) -> bool:
|
||||
if not files:
|
||||
if not files or len(files) == 0:
|
||||
result = self.run_git_command(['add', '.'])
|
||||
else:
|
||||
result = self.run_git_command(['add'] + files)
|
||||
@ -215,7 +215,7 @@ class GitAgent:
|
||||
# Initialize components
|
||||
self.git = GitUtils(self.config, self.logger)
|
||||
|
||||
self.logger.info("🤖 Git Agent initialized")
|
||||
self.logger.info("Git Agent initialized")
|
||||
|
||||
def load_config(self, config_path: str) -> Dict[str, Any]:
|
||||
try:
|
||||
@ -277,12 +277,7 @@ class GitAgent:
|
||||
|
||||
# Stage and commit changes
|
||||
change_count = len(self.git.get_changed_files())
|
||||
commit_message = f"{branch_name}: Automated backup - {change_count} files changed
|
||||
|
||||
📋 Files modified: {change_count}
|
||||
⏰ Timestamp: {timestamp.strftime('%Y-%m-%d %H:%M:%S')} UTC
|
||||
🔒 Security: PASSED (no secrets detected)
|
||||
💾 Automated by Git Agent"
|
||||
commit_message = f"{branch_name}: Automated backup - {change_count} files changed\n\n📋 Files modified: {change_count}\n⏰ Timestamp: {timestamp.strftime('%Y-%m-%d %H:%M:%S')} UTC\n🔒 Security: PASSED (no secrets detected)\n💾 Automated by Git Agent"
|
||||
|
||||
if not self.git.commit_changes(commit_message):
|
||||
self.logger.error("❌ Failed to commit changes")
|
||||
@ -396,7 +391,7 @@ def main():
|
||||
print(f"❌ Status error: {status['error']}")
|
||||
sys.exit(1)
|
||||
|
||||
print("📊 Git Agent Status:")
|
||||
print("Git Agent Status:")
|
||||
print(f" Current Branch: {status['current_branch']}")
|
||||
print(f" Backup Count: {status['backup_count']}")
|
||||
print(f" Has Changes: {status['has_changes']}")
|
||||
|
||||
Reference in New Issue
Block a user