Skip to content

Silently ignore gitpython import errors. #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 21, 2025
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
11 changes: 9 additions & 2 deletions agentstack/repo.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from typing import Optional
from types import ModuleType
from pathlib import Path
import shutil
import git
from agentstack import conf, log
from agentstack.exceptions import EnvironmentError


MAIN_BRANCH_NAME = "main"

AUTOMATION_NOTE = "\n\n(This commit was made automatically by AgentStack)"
Expand All @@ -15,6 +14,14 @@
_USE_GIT = None # global state to disable git for this run


# The python git module prints an excessive error message when git is not
# installed. We always want to allow git support to fail silently.
try:
import git
except ImportError:
_USE_GIT = False


def should_track_changes() -> bool:
"""
If git has been disabled for this run, return False. Next, look for the value
Expand Down
Loading