git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
a2eaa877a26a9395b0d1fb8b0684b9df452deeb9 blob 2989 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
 
#!/bin/sh

test_description='push with --set-upstream'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh

ensure_fresh_upstream() {
	rm -rf parent && git init --bare parent
}

test_expect_success 'setup bare parent' '
	ensure_fresh_upstream &&
	git remote add upstream parent
'

test_expect_success 'setup local commit' '
	echo content >file &&
	git add file &&
	git commit -m one
'

check_config() {
	(echo $2; echo $3) >expect.$1
	(git config branch.$1.remote
	 git config branch.$1.merge) >actual.$1
	test_cmp expect.$1 actual.$1
}

test_expect_success 'push -u main:main' '
	git push -u upstream main:main &&
	check_config main upstream refs/heads/main
'

test_expect_success 'push -u main:other' '
	git push -u upstream main:other &&
	check_config main upstream refs/heads/other
'

test_expect_success 'push -u --dry-run main:otherX' '
	git push -u --dry-run upstream main:otherX &&
	check_config main upstream refs/heads/other
'

test_expect_success 'push -u topic_2:topic_2' '
	git branch topic_2 &&
	git push -u upstream topic_2:topic_2 &&
	check_config topic_2 upstream refs/heads/topic_2
'

test_expect_success 'push -u topic_2:other2' '
	git push -u upstream topic_2:other2 &&
	check_config topic_2 upstream refs/heads/other2
'

test_expect_success 'push -u :topic_2' '
	git push -u upstream :topic_2 &&
	check_config topic_2 upstream refs/heads/other2
'

test_expect_success 'push -u --all' '
	git branch all1 &&
	git branch all2 &&
	git push -u --all &&
	check_config all1 upstream refs/heads/all1 &&
	check_config all2 upstream refs/heads/all2
'

test_expect_success 'push -u HEAD' '
	git checkout -b headbranch &&
	git push -u upstream HEAD &&
	check_config headbranch upstream refs/heads/headbranch
'

test_expect_success TTY 'progress messages go to tty' '
	ensure_fresh_upstream &&

	test_terminal git push -u upstream main >out 2>err &&
	test_i18ngrep "Writing objects" err
'

test_expect_success 'progress messages do not go to non-tty' '
	ensure_fresh_upstream &&

	# skip progress messages, since stderr is non-tty
	git push -u upstream main >out 2>err &&
	test_i18ngrep ! "Writing objects" err
'

test_expect_success 'progress messages go to non-tty (forced)' '
	ensure_fresh_upstream &&

	# force progress messages to stderr, even though it is non-tty
	git push -u --progress upstream main >out 2>err &&
	test_i18ngrep "Writing objects" err
'

test_expect_success TTY 'push -q suppresses progress' '
	ensure_fresh_upstream &&

	test_terminal git push -u -q upstream main >out 2>err &&
	test_i18ngrep ! "Writing objects" err
'

test_expect_success TTY 'push --no-progress suppresses progress' '
	ensure_fresh_upstream &&

	test_terminal git push -u --no-progress upstream main >out 2>err &&
	test_i18ngrep ! "Unpacking objects" err &&
	test_i18ngrep ! "Writing objects" err
'

test_expect_success TTY 'quiet push' '
	ensure_fresh_upstream &&

	test_terminal git push --quiet --no-progress upstream main 2>&1 | tee output &&
	test_must_be_empty output
'

test_done
debug log:

solving a2eaa877a2 ...
found a2eaa877a2 in https://public-inbox.org/git/3aef39320e96aad10e133f1c97a9010aa85aa894.1605221039.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/4b1b1ee51f19b6625118f39ac1389b485f99290a.1605629548.git.gitgitgadget@gmail.com/
found e47b5db5d6 in git.git.git
preparing index
index prepared:
100755 e47b5db5d6603af4c63cf50a1aede28018ac564a	t/t5523-push-upstream.sh

applying [1/2] https://public-inbox.org/git/3aef39320e96aad10e133f1c97a9010aa85aa894.1605221039.git.gitgitgadget@gmail.com/
diff --git a/t/t5523-push-upstream.sh b/t/t5523-push-upstream.sh
index e47b5db5d6..a2eaa877a2 100755

Checking patch t/t5523-push-upstream.sh...
Applied patch t/t5523-push-upstream.sh cleanly.

skipping https://public-inbox.org/git/4b1b1ee51f19b6625118f39ac1389b485f99290a.1605629548.git.gitgitgadget@gmail.com/ for a2eaa877a2
index at:
100755 a2eaa877a26a9395b0d1fb8b0684b9df452deeb9	t/t5523-push-upstream.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 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