git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
54bc3d2c9c3e31421a90eeb8de6a96847d28fa7c blob 3202 bytes (raw)

  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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
 
#!/bin/sh

test_description='unpack-trees error messages'

. ./test-lib.sh


test_expect_success 'setup' '
	echo one >one &&
	git add one &&
	git commit -a -m First &&

	git checkout -b branch &&
	echo two >two &&
	echo three >three &&
	echo four >four &&
	echo five >five &&
	git add two three four five &&
	git commit -m Second &&

	git checkout master &&
	echo other >two &&
	echo other >three &&
	echo other >four &&
	echo other >five
'

cat >expect <<\EOF
error: The following untracked working tree files would be overwritten by merge:
error: 	five
error: 	four
error: 	three
error: 	two
error: Please move or remove them before you merge.
Aborting
EOF

test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
	test_must_fail git merge branch 2>out &&
	test_i18ncmp out expect &&
	git commit --allow-empty -m empty &&
	(
		GIT_MERGE_VERBOSITY=0 &&
		export GIT_MERGE_VERBOSITY &&
		test_must_fail git merge branch 2>out2
	) &&
	test_i18ncmp out2 expect &&
	git reset --hard HEAD^
'

cat >expect <<\EOF
error: Your local changes to the following files would be overwritten by merge:
error: 	four
error: 	three
error: 	two
error: Please commit your changes or stash them before you merge.
error: The following untracked working tree files would be overwritten by merge:
error: 	five
error: Please move or remove them before you merge.
Aborting
EOF

test_expect_success 'untracked files or local changes ovewritten by merge' '
	git add two &&
	git add three &&
	git add four &&
	test_must_fail git merge branch 2>out &&
	test_i18ncmp out expect
'

cat >expect <<\EOF
error: Your local changes to the following files would be overwritten by checkout:
error: 	rep/one
error: 	rep/two
error: Please commit your changes or stash them before you switch branches.
Aborting
EOF

test_expect_success 'cannot switch branches because of local changes' '
	git add five &&
	mkdir rep &&
	echo one >rep/one &&
	echo two >rep/two &&
	git add rep/one rep/two &&
	git commit -m Fourth &&
	git checkout master &&
	echo uno >rep/one &&
	echo dos >rep/two &&
	test_must_fail git checkout branch 2>out &&
	test_i18ncmp out expect
'

cat >expect <<\EOF
error: Your local changes to the following files would be overwritten by checkout:
error: 	rep/one
error: 	rep/two
error: Please commit your changes or stash them before you switch branches.
Aborting
EOF

test_expect_success 'not uptodate file porcelain checkout error' '
	git add rep/one rep/two &&
	test_must_fail git checkout branch 2>out &&
	test_i18ncmp out expect
'

cat >expect <<\EOF
error: Updating the following directories would lose untracked files in them:
error: 	rep
error: 	rep2
Aborting
EOF

test_expect_success 'not_uptodate_dir porcelain checkout error' '
	git init uptodate &&
	cd uptodate &&
	mkdir rep &&
	mkdir rep2 &&
	touch rep/foo &&
	touch rep2/foo &&
	git add rep/foo rep2/foo &&
	git commit -m init &&
	git checkout -b branch &&
	git rm rep -r &&
	git rm rep2 -r &&
	>rep &&
	>rep2 &&
	git add rep rep2&&
	git commit -m "added test as a file" &&
	git checkout master &&
	>rep/untracked-file &&
	>rep2/untracked-file &&
	test_must_fail git checkout branch 2>out &&
	test_i18ncmp out ../expect
'

test_done
debug log:

solving 54bc3d2c9c ...
found 54bc3d2c9c in https://public-inbox.org/git/ef5b4e28e00ad0c95dbe625d2e7305957f9fe5ba.1527279322.git.martin.agren@gmail.com/
found e90413204e in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 e90413204ee32cafc3380244a5cf013eadcd72c1	t/t7609-merge-co-error-msgs.sh

applying [1/1] https://public-inbox.org/git/ef5b4e28e00ad0c95dbe625d2e7305957f9fe5ba.1527279322.git.martin.agren@gmail.com/
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh
index e90413204e..54bc3d2c9c 100755

Checking patch t/t7609-merge-co-error-msgs.sh...
Applied patch t/t7609-merge-co-error-msgs.sh cleanly.

index at:
100755 54bc3d2c9c3e31421a90eeb8de6a96847d28fa7c	t/t7609-merge-co-error-msgs.sh

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git