Skip to content

Commit 2c00b45

Browse files
committed
fix: Also update tests
1 parent 8399101 commit 2c00b45

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/hooks/test_git_hook.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,19 @@ def repo_dir(tmp_path):
317317
def repo(repo_dir, dbt_project_file, test_files, profiles_file, repo_branch):
318318
"""Initialize a git repo with some dbt test files."""
319319
repo = Repo.init(repo_dir, default_branch=repo_branch)
320+
320321
shutil.copyfile(dbt_project_file, repo_dir / "dbt_project.yml")
321-
repo.stage("dbt_project.yml")
322+
repo.get_worktree().stage("dbt_project.yml")
322323

323324
shutil.copyfile(profiles_file, repo_dir / "profiles.yml")
324-
repo.stage("profiles.yml")
325+
repo.get_worktree().stage("profiles.yml")
325326

326327
for test_file in test_files:
327328
remote_subdir = repo_dir / test_file.parent.name
328329
remote_subdir.mkdir(exist_ok=True)
329330
shutil.copyfile(test_file, remote_subdir / test_file.name)
330331

331-
repo.stage(f"{test_file.parent.name}/{test_file.name}")
332+
repo.get_worktree().stage(f"{test_file.parent.name}/{test_file.name}")
332333

333334
repo.do_commit(b"Test first commit", committer=b"Test user <test@user.com>")
334335

0 commit comments

Comments
 (0)