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