test: fix test failure in case of different default branch (#6857)

* test: fix test failure in case of different default branch

When the git config has set global `init.defaultBranch` different than master,
a few test cases were failing.
Currently, the test case is assuming the default branch to be set as
master.

This commit will introduce **initial_branch** option to git init call
which will ensure *master* branch is used as default for out test cases.

Set default git branch to main for test CI

Since main is going to be new default branch, it will let the test case
handle the scenario where default branch is set other than master.

Introduce isolation for git configuration

Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
This commit is contained in:
Amrit Ghimire
2022-01-07 11:13:04 +05:45
committed by GitHub
co-authored by Saugat Pachhai
parent ec3600eb8e
commit 44a1146915
10 changed files with 66 additions and 66 deletions
-4
View File
@@ -67,10 +67,6 @@ jobs:
run: |
pip install --upgrade pip setuptools wheel
pip install -e ".[dev]"
- name: setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "DVC Tester"
- name: run tests
timeout-minutes: 40
run: >-