]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib: let test_merge() perform octopus merges
authorDenton Liu <liu.denton@gmail.com>
Fri, 4 Oct 2019 00:23:13 +0000 (17:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Oct 2019 00:28:00 +0000 (09:28 +0900)
Currently test_merge() only allows developers to merge in one branch.
However, this restriction is artificial and there is no reason why it
needs to be this way.

Extend test_merge() to allow the specification of multiple branches so
that octopus merges can be performed.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib-functions.sh

index e0b3f28d3a96e1b937f4c31e0a3d2e8fb3e6fed5..6620ef2f34124b00d5ea4c5867a3443e1ad8aaa8 100644 (file)
@@ -228,9 +228,11 @@ test_commit () {
 # can be a tag pointing to the commit-to-merge.
 
 test_merge () {
+       label="$1" &&
+       shift &&
        test_tick &&
-       git merge -m "$1" "$2" &&
-       git tag "$1"
+       git merge -m "$label" "$@" &&
+       git tag "$label"
 }
 
 # Efficiently create <nr> commits, each with a unique number (from 1 to <nr>