Patchwork D9746: tests: make test-subrepo-git.t compatible with git's master->main rename

login
register
mail settings
Submitter phabricator
Date Jan. 13, 2021, 1:34 a.m.
Message ID <differential-rev-PHID-DREV-osmopokuzwdyofizn3zx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48057/
State Superseded
Headers show

Comments

phabricator - Jan. 13, 2021, 1:34 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Git is about to change the default branch from "master" to
  "main". Recent versions has started warning about that, which makes
  tests fail. I assume the tests would fail in a different way once the
  default has changed. To make us compatible with that name change,
  let's set configure the default to be "master". That value makes the
  tests still work on older Git version (those where the default branch
  name is not configurable).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9746

AFFECTED FILES
  tests/test-subrepo-git.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -17,6 +17,10 @@ 
   $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
   $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
 
+set default branch to value compatible with new and old git version
+
+  $ git config --global init.defaultBranch master
+
 root hg repo
 
   $ hg init t