From d822b5f905964e15933d935b6a63f430013877b3 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 11 Jan 2021 09:23:34 -0800 Subject: [PATCH 1/2] Revert "Future proof git init in tests" This reverts commit de2e72f376426ad00e7a28b1b51be2289585a4cb. Signed-off-by: Rudi Grinberg --- otherlibs/build-info/test/run.t | 2 +- .../test-cases/dune-project-meta/main.t/run.t | 4 ++-- test/blackbox-tests/test-cases/meta-template-version-bug.t | 2 +- test/blackbox-tests/test-cases/subst.t/run.t | 6 +++--- test/expect-tests/vcs_tests.ml | 7 ++----- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/otherlibs/build-info/test/run.t b/otherlibs/build-info/test/run.t index d3e65b8725d..ec3b401e34e 100644 --- a/otherlibs/build-info/test/run.t +++ b/otherlibs/build-info/test/run.t @@ -11,7 +11,7 @@ Test embedding of build information > (package (name $i)) > EOF > (cd $i; - > git init --initial-branch master -q + > git init -q; > git add .; > git commit -q -m _; > git tag -a 1.0+$i -m _) diff --git a/test/blackbox-tests/test-cases/dune-project-meta/main.t/run.t b/test/blackbox-tests/test-cases/dune-project-meta/main.t/run.t index f50097fecdf..c8ffffb40f5 100644 --- a/test/blackbox-tests/test-cases/dune-project-meta/main.t/run.t +++ b/test/blackbox-tests/test-cases/dune-project-meta/main.t/run.t @@ -182,7 +182,7 @@ generated META and opam files. > EOF $ (cd version - > git init --initial-branch master -q + > git init -q > git add . > git commit -qm _ > git tag -a 1.0 -m 1.0 @@ -217,7 +217,7 @@ generated META and opam files. > EOF $ (cd version - > git init --initial-branch master -q + > git init -q > git add . > git commit -qm _ > git tag -a 1.0 -m 1.0 diff --git a/test/blackbox-tests/test-cases/meta-template-version-bug.t b/test/blackbox-tests/test-cases/meta-template-version-bug.t index 71380112aef..9ed31193c0e 100644 --- a/test/blackbox-tests/test-cases/meta-template-version-bug.t +++ b/test/blackbox-tests/test-cases/meta-template-version-bug.t @@ -1,7 +1,7 @@ This test demonstrates a bug when there's a package with a meta template and a custom version: - $ git init --initial-branch master -q + $ git init -q $ git add . $ git commit -qm _ $ git tag -a 1.0 -m 1.0 diff --git a/test/blackbox-tests/test-cases/subst.t/run.t b/test/blackbox-tests/test-cases/subst.t/run.t index 6e6ee340a2a..a22a7541573 100644 --- a/test/blackbox-tests/test-cases/subst.t/run.t +++ b/test/blackbox-tests/test-cases/subst.t/run.t @@ -14,7 +14,7 @@ Project with opam files $ echo 'authors: [ "John Doe " ]' > foo.opam - $ git init --initial-branch master -q + $ git init --quiet $ git add . $ git commit -am _ --quiet $ git tag -a 1.0 -m 1.0 @@ -51,7 +51,7 @@ And without an opam file preset. > let version = "${X}VERSION${X}" > EOF - $ git init --initial-branch master -q + $ git init --quiet $ git add . $ git commit -am _ --quiet $ git tag -a 1.0 -m 1.0 @@ -88,7 +88,7 @@ Test subst and files with unicode (#3879) > let version = "${X}VERSION${X}" > EOF - $ git init --initial-branch master -q + $ git init --quiet $ git add . $ git commit -am _ --quiet $ git tag -a 1.0 -m 1.0 diff --git a/test/expect-tests/vcs_tests.ml b/test/expect-tests/vcs_tests.ml index 203c2612e3b..0bc12ee7a2f 100644 --- a/test/expect-tests/vcs_tests.ml +++ b/test/expect-tests/vcs_tests.ml @@ -57,10 +57,7 @@ type action = let run_action (vcs : Vcs.t) action = match action with - | Init -> ( - match vcs.kind with - | Hg -> run vcs [ "init" ] - | Git -> run vcs [ "init"; "--initial-branch"; "master" ] ) + | Init -> run vcs [ "init" ] | Add fn -> run vcs [ "add"; fn ] | Commit -> ( match vcs.kind with @@ -150,7 +147,7 @@ let%expect_test _ = run Git script; [%expect {| -$ git init --initial-branch master +$ git init $ echo "-" > a $ git add a $ git commit -m 'commit message' From 622a26f187ec9281703501fbac8adcc559e33f95 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 11 Jan 2021 09:41:43 -0800 Subject: [PATCH 2/2] Add -q to hg/git init calls Signed-off-by: Rudi Grinberg --- test/expect-tests/vcs_tests.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/expect-tests/vcs_tests.ml b/test/expect-tests/vcs_tests.ml index 0bc12ee7a2f..af62c94508b 100644 --- a/test/expect-tests/vcs_tests.ml +++ b/test/expect-tests/vcs_tests.ml @@ -57,7 +57,7 @@ type action = let run_action (vcs : Vcs.t) action = match action with - | Init -> run vcs [ "init" ] + | Init -> run vcs [ "init"; "-q" ] | Add fn -> run vcs [ "add"; fn ] | Commit -> ( match vcs.kind with @@ -147,7 +147,7 @@ let%expect_test _ = run Git script; [%expect {| -$ git init +$ git init -q $ echo "-" > a $ git add a $ git commit -m 'commit message' @@ -190,7 +190,7 @@ let%expect_test _ = run Hg script; [%expect {| -$ hg init +$ hg init -q $ echo "-" > a $ hg add a $ hg commit -m 'commit message' -u toto