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

test_description='.git file

Verify that plumbing commands work when .git is a file
'
. ./test-lib.sh

objpath() {
	echo "$1" | sed -e 's|\(..\)|\1/|'
}

test_expect_success 'initial setup' '
	REAL="$(pwd)/.real" &&
	mv .git "$REAL"
'

test_expect_success 'bad setup: invalid .git file format' '
	echo "gitdir $REAL" >.git &&
	test_must_fail git rev-parse 2>.err &&
	test_i18ngrep "invalid gitfile format" .err
'

test_expect_success 'bad setup: invalid .git file path' '
	echo "gitdir: $REAL.not" >.git &&
	test_must_fail git rev-parse 2>.err &&
	test_i18ngrep "not a git repository" .err
'

test_expect_success 'final setup + check rev-parse --git-dir' '
	echo "gitdir: $REAL" >.git &&
	test "$REAL" = "$(git rev-parse --git-dir)"
'

test_expect_success 'check hash-object' '
	echo "foo" >bar &&
	SHA=$(cat bar | git hash-object -w --stdin) &&
	test_path_is_file "$REAL/objects/$(objpath $SHA)"
'

test_expect_success 'check cat-file' '
	git cat-file blob $SHA >actual &&
	test_cmp bar actual
'

test_expect_success 'check update-index' '
	test_path_is_missing "$REAL/index" &&
	rm -f "$REAL/objects/$(objpath $SHA)" &&
	git update-index --add bar &&
	test_path_is_file "$REAL/index" &&
	test_path_is_file "$REAL/objects/$(objpath $SHA)"
'

test_expect_success 'check write-tree' '
	SHA=$(git write-tree) &&
	test_path_is_file "$REAL/objects/$(objpath $SHA)"
'

test_expect_success 'check commit-tree' '
	SHA=$(echo "commit bar" | git commit-tree $SHA) &&
	test_path_is_file "$REAL/objects/$(objpath $SHA)"
'

test_expect_success 'check rev-list' '
	git update-ref "HEAD" "$SHA" &&
	test "$SHA" = "$(git rev-list HEAD)"
'

test_expect_success 'setup_git_dir twice in subdir' '
	git init sgd &&
	(
		cd sgd &&
		git config alias.lsfi ls-files &&
		mv .git .realgit &&
		echo "gitdir: .realgit" >.git &&
		mkdir subdir &&
		cd subdir &&
		>foo &&
		git add foo &&
		git lsfi >actual &&
		echo foo >expected &&
		test_cmp expected actual
	)
'

test_expect_success 'enter_repo non-strict mode' '
	test_create_repo enter_repo &&
	(
		cd enter_repo &&
		test_tick &&
		test_commit foo &&
		mv .git .realgit &&
		echo "gitdir: .realgit" >.git
	) &&
	head=$(git -C enter_repo rev-parse HEAD) &&
	git ls-remote enter_repo >actual &&
	cat >expected <<-EOF &&
	$head	HEAD
	$head	refs/heads/main
	$head	refs/tags/foo
	EOF
	test_cmp expected actual
'

test_expect_success 'enter_repo linked checkout' '
	(
		cd enter_repo &&
		git worktree add  ../foo refs/tags/foo
	) &&
	head=$(git -C enter_repo rev-parse HEAD) &&
	git ls-remote foo >actual &&
	cat >expected <<-EOF &&
	$head	HEAD
	$head	refs/heads/main
	$head	refs/tags/foo
	EOF
	test_cmp expected actual
'

test_expect_success 'enter_repo strict mode' '
	head=$(git -C enter_repo rev-parse HEAD) &&
	git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual &&
	cat >expected <<-EOF &&
	$head	HEAD
	$head	refs/heads/main
	$head	refs/tags/foo
	EOF
	test_cmp expected actual
'

test_done
debug log:

solving bbcfc8a0b5 ...
found bbcfc8a0b5 in https://public-inbox.org/git/830130fa9fff3bf39e9f5b0360160e9ff787deec.1605221038.git.gitgitgadget@gmail.com/ ||
	https://public-inbox.org/git/b8fa037791683b50c3efb01aa6ac0d3f7b888a2b.1605629548.git.gitgitgadget@gmail.com/
found 960ed150cb in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 960ed150cb59055fb3f597a0cc80542828ac4ebb	t/t0002-gitfile.sh

applying [1/2] https://public-inbox.org/git/830130fa9fff3bf39e9f5b0360160e9ff787deec.1605221038.git.gitgitgadget@gmail.com/
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 960ed150cb..bbcfc8a0b5 100755

Checking patch t/t0002-gitfile.sh...
Applied patch t/t0002-gitfile.sh cleanly.

skipping https://public-inbox.org/git/b8fa037791683b50c3efb01aa6ac0d3f7b888a2b.1605629548.git.gitgitgadget@gmail.com/ for bbcfc8a0b5
index at:
100755 bbcfc8a0b5fcc6d3001143fee4b2162e5eacad27	t/t0002-gitfile.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