git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob c830025470f66f73e4f415457cd4c725fb0c8ccc 2484 bytes (raw)
name: t/t3422-rebase-incompatible-options.sh 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
 
#!/bin/sh

test_description='test if rebase detects and aborts on incompatible options'

TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh

test_expect_success 'setup' '
	test_seq 2 9 >foo &&
	git add foo &&
	git commit -m orig &&

	git branch A &&
	git branch B &&

	git checkout A &&
	test_seq 1 9 >foo &&
	git add foo &&
	git commit -m A &&

	git checkout B &&
	echo "q qfoo();" | q_to_tab >>foo &&
	git add foo &&
	git commit -m B
'

#
# Rebase has a couple options which are specific to the apply backend,
# and several options which are specific to the merge backend.  Flags
# from the different sets cannot work together, and we do not want to
# just ignore one of the sets of flags.  Make sure rebase warns the
# user and aborts instead.
#

test_rebase_am_only () {
	opt=$1
	shift
	test_expect_success "$opt incompatible with --merge" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --merge A
	"

	test_expect_success "$opt incompatible with --strategy=ours" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --strategy=ours A
	"

	test_expect_success "$opt incompatible with --strategy-option=ours" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --strategy-option=ours A
	"

	test_expect_success "$opt incompatible with --autosquash" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --autosquash A
	"

	test_expect_success "$opt incompatible with --interactive" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --interactive A
	"

	test_expect_success "$opt incompatible with --exec" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --exec 'true' A
	"

	test_expect_success "$opt incompatible with --keep-empty" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --keep-empty A
	"

	test_expect_success "$opt incompatible with --empty=..." "
		git checkout B^0 &&
		test_must_fail git rebase $opt --empty=ask A
	"

	test_expect_success "$opt incompatible with --no-reapply-cherry-picks" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --no-reapply-cherry-picks A
	"

	test_expect_success "$opt incompatible with --update-refs" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --update-refs A
	"

	test_expect_success "$opt incompatible with --root without --onto" "
		git checkout B^0 &&
		test_must_fail git rebase $opt --root A
	"
}

# Check options which imply --apply
test_rebase_am_only --whitespace=fix
test_rebase_am_only -C4
# Also check an explicit --apply
test_rebase_am_only --apply

test_done

debug log:

solving c830025470f ...
found c830025470f in https://public-inbox.org/git/48c40c0dda00eeb8b9bdc5ba9372b46964eea14a.1674266126.git.gitgitgadget@gmail.com/
found f86274990b0 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 f86274990b0ad11062a1fc0eb3c865d8090f48fa	t/t3422-rebase-incompatible-options.sh

applying [1/1] https://public-inbox.org/git/48c40c0dda00eeb8b9bdc5ba9372b46964eea14a.1674266126.git.gitgitgadget@gmail.com/
diff --git a/t/t3422-rebase-incompatible-options.sh b/t/t3422-rebase-incompatible-options.sh
index f86274990b0..c830025470f 100755

Checking patch t/t3422-rebase-incompatible-options.sh...
Applied patch t/t3422-rebase-incompatible-options.sh cleanly.

index at:
100755 c830025470f66f73e4f415457cd4c725fb0c8ccc	t/t3422-rebase-incompatible-options.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).