X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=test%2Fint%2Ftest_git.py;h=7965c60ce2314ab2105aa20c1ab405fa68e47720;hb=54b0467e48d27925ca8368d1f03c6254412b2786;hp=0b114f1644bb4d5f73ba2c0660e25319a6a88be9;hpb=d600f2a0c4614aa787e5721e03fe32dd91a22455;p=bup.git diff --git a/test/int/test_git.py b/test/int/test_git.py index 0b114f1..7965c60 100644 --- a/test/int/test_git.py +++ b/test/int/test_git.py @@ -4,7 +4,7 @@ import sys from binascii import hexlify, unhexlify from subprocess import check_call from functools import partial -import struct, os, time +import struct, os import pytest from wvpytest import * @@ -255,8 +255,9 @@ def test_commit_parsing(tmpdir): environ[b'GIT_AUTHOR_EMAIL'] = b'bup@a425bc70a02811e49bdf73ee56450e6f' environ[b'GIT_COMMITTER_EMAIL'] = environ[b'GIT_AUTHOR_EMAIL'] try: - readpipe([b'git', b'init', workdir]) environ[b'GIT_DIR'] = environ[b'BUP_DIR'] = repodir + readpipe([b'git', b'init', workdir]) + exc(b'git', b'symbolic-ref', b'HEAD', b'refs/heads/main') git.check_repo_or_die(repodir) os.chdir(workdir) with open('foo', 'w') as f: @@ -265,7 +266,7 @@ def test_commit_parsing(tmpdir): readpipe([b'git', b'commit', b'-am', b'Do something', b'--author', b'Someone ', b'--date', b'Sat Oct 3 19:48:49 2009 -0400']) - commit = readpipe([b'git', b'show-ref', b'-s', b'master']).strip() + commit = readpipe([b'git', b'show-ref', b'-s', b'main']).strip() parents = showval(commit, b'%P') tree = showval(commit, b'%T') cname = showval(commit, b'%cn') @@ -292,7 +293,7 @@ def test_commit_parsing(tmpdir): f.write(b'baz\n') readpipe([b'git', b'add', '.']) readpipe([b'git', b'commit', b'-am', b'Do something else']) - child = readpipe([b'git', b'show-ref', b'-s', b'master']).strip() + child = readpipe([b'git', b'show-ref', b'-s', b'main']).strip() parents = showval(child, b'%P') commit_items = git.get_commit_items(child, git.cp()) WVPASSEQ(commit_items.parents, [commit])