Skip to content

Some git-related tests fail when defaultBranch is not master #6998

@guludo

Description

@guludo

Bug Report

Description

When git configuration for init.defaultBranch is a value different from master some tests fail.

Reproduce

Steps to reproduce:

  1. Set the value of init.defaultBranch to a value other than master:
    $ git config --global init.defaultBranch main
  2. Run a git-related test:
       $ python -m tests 'tests/func/test_checkout.py::TestRemoveFilesWhenCheckout::test'
       =============================================================================================== test session starts ================================================================================================
       platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /home/guludo/foss/dvc/venv/bin/python
       cachedir: .pytest_cache
       rootdir: /home/guludo/foss/dvc, configfile: pyproject.toml
       plugins: anyio-3.3.4, forked-1.3.0, xdist-2.4.0, mock-3.6.1, lazy-fixture-0.6.3, docker-0.10.3, cov-3.0.0, flaky-3.7.0
       [gw0] linux Python 3.9.7 cwd: /home/guludo/foss/dvc
       [gw1] linux Python 3.9.7 cwd: /home/guludo/foss/dvc
       [gw0] Python 3.9.7 (default, Oct 10 2021, 15:13:22)  -- [GCC 11.1.0]
       [gw1] Python 3.9.7 (default, Oct 10 2021, 15:13:22)  -- [GCC 11.1.0]
       gw0 [1] / gw1 [1]
       scheduling tests via LoadScopeScheduling
    
       tests/func/test_checkout.py::TestRemoveFilesWhenCheckout::test
       [gw0] [100%] FAILED tests/func/test_checkout.py::TestRemoveFilesWhenCheckout::test
       
       (...)   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions