Skip to content

Commit 1b15ea1

Browse files
committed
Fix bug related to breaking changes in new dulwich versioN
1 parent cfac255 commit 1b15ea1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • airflow_dbt_python/hooks/fs

airflow_dbt_python/hooks/fs/git.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def _upload(
9393
if self.upload_filter(f) is False:
9494
continue
9595

96+
# Starting from dulwich version 1.0.0, stage is an attribute of WorkTree class
97+
try:
9698
repo.stage(str(f.relative_to(source)))
99+
except AttributeError:
100+
repo.get_worktree().stage(str(f.relative_to(source)))
101+
97102

98103
ts = dt.datetime.now(dt.timezone.utc)
99104
repo.do_commit(

0 commit comments

Comments
 (0)