Skip to content

Commit

Permalink
Python 2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Aug 28, 2020
1 parent 1286731 commit 1dda515
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/functional/test_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,20 @@ def test_resolve_commit_not_on_branch(script, tmp_path):
repo_file = repo_path / "file.txt"
clone_path = repo_path / "clone"
repo_path.mkdir()
script.run("git", "init", cwd=repo_path)
repo_file.write_text(".")
script.run("git", "add", "file.txt", cwd=repo_path)
script.run("git", "commit", "-m", "initial commit", cwd=repo_path)
script.run("git", "checkout", "-b", "abranch", cwd=repo_path)
script.run("git", "init", cwd=str(repo_path))
repo_file.write_text(u".")
script.run("git", "add", "file.txt", cwd=str(repo_path))
script.run("git", "commit", "-m", "initial commit", cwd=str(repo_path))
script.run("git", "checkout", "-b", "abranch", cwd=str(repo_path))
# create a commit
repo_file.write_text("..")
script.run("git", "commit", "-a", "-m", "commit 1", cwd=repo_path)
repo_file.write_text(u"..")
script.run("git", "commit", "-a", "-m", "commit 1", cwd=str(repo_path))
commit = script.run(
"git", "rev-parse", "HEAD", cwd=repo_path
"git", "rev-parse", "HEAD", cwd=str(repo_path)
).stdout.strip()
# make sure our commit is not on a branch
script.run("git", "checkout", "master", cwd=repo_path)
script.run("git", "branch", "-D", "abranch", cwd=repo_path)
script.run("git", "checkout", "master", cwd=str(repo_path))
script.run("git", "branch", "-D", "abranch", cwd=str(repo_path))
# create a ref that points to our commit
(repo_path / ".git" / "refs" / "myrefs").mkdir(parents=True)
(repo_path / ".git" / "refs" / "myrefs" / "myref").write_text(commit)
Expand Down

0 comments on commit 1dda515

Please sign in to comment.