Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions providers/git/src/airflow/providers/git/bundles/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def __init__(
self._log.debug("bundle configured")
self.hook: GitHook | None = None
try:
self.hook = GitHook(git_conn_id=git_conn_id or "git_default")
self.hook = GitHook(git_conn_id=git_conn_id or "git_default", repo_url=self.repo_url)
except Exception as e:
self._log.warning("Could not create GitHook", conn_id=git_conn_id, exc=e)

if not repo_url and self.hook and self.hook.repo_url:
if self.hook and self.hook.repo_url:
self.repo_url = self.hook.repo_url
self._log.debug("repo_url updated from hook")

Expand Down
2 changes: 1 addition & 1 deletion providers/git/tests/unit/git/bundles/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_https_access_token_repo_url_overrides_connection_host_when_provided(sel
tracking_ref=GIT_DEFAULT_BRANCH,
repo_url="https://github.com/apache/zzzairflow",
)
assert bundle.repo_url == "https://github.com/apache/zzzairflow"
assert bundle.repo_url == f"https://user:{ACCESS_TOKEN}@github.com/apache/zzzairflow"

def test_falls_back_to_connection_host_when_no_repo_url_provided(self):
bundle = GitDagBundle(name="test", git_conn_id=CONN_HTTPS, tracking_ref=GIT_DEFAULT_BRANCH)
Expand Down