]> arthur.barton.de Git - bup.git/blobdiff - test/int/test_git.py
test: add pylint and test imports
[bup.git] / test / int / test_git.py
index 0b114f1644bb4d5f73ba2c0660e25319a6a88be9..7965c60ce2314ab2105aa20c1ab405fa68e47720 100644 (file)
@@ -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 <someone@somewhere>',
                   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])