Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/praisonai-agents/praisonaiagents/tools/github_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
def github_create_branch(branch_name: str) -> str:
"""Create and checkout a new git branch.

logger.debug(f"Branch '{branch_name}' checked out successfully.")
Args:
branch_name: The name of the branch to create and checkout.
"""
try:
# Check if we are in a git repository
subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], check=True, capture_output=True)
subprocess.run(["git", "checkout", "-B", branch_name], check=True, capture_output=True, text=True)
logger.debug(f"Successfully checked out branch '{branch_name}'")
return f"Successfully created and checked out branch '{branch_name}'"
except subprocess.CalledProcessError as e:
logger.error(f"Failed to create branch: {e.stderr}")
Expand Down
Loading