Skip to content

Commit 7159013

Browse files
committed
Merge branch 'mechanical-fixes'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents 1dd2d99 + dcc3838 commit 7159013

File tree

114 files changed

+559
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+559
-559
lines changed

t/annotate-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test_expect_success 'blame with --contents' '
8686
test_expect_success 'blame with --contents in a bare repo' '
8787
git clone --bare . bare-contents.git &&
8888
(
89-
cd bare-contents.git &&
89+
cd bare-contents.git && GIT_DIR=. && export GIT_DIR &&
9090
echo "1A quick brown fox jumps over the" >contents &&
9191
check_count --contents=contents A 1
9292
)
@@ -101,7 +101,7 @@ test_expect_success 'blame with --contents changed' '
101101
test_expect_success 'blame in a bare repo without starting commit' '
102102
git clone --bare . bare.git &&
103103
(
104-
cd bare.git &&
104+
cd bare.git && GIT_DIR=. && export GIT_DIR &&
105105
check_count A 2
106106
)
107107
'

t/lib-bitmap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ basic_bitmap_tests () {
207207
rm -fr partial-clone.git &&
208208
git clone --no-local --bare --filter=blob:none . partial-clone.git &&
209209
(
210-
cd partial-clone.git &&
210+
cd partial-clone.git && GIT_DIR=. && export GIT_DIR &&
211211
pack=$(echo objects/pack/*.pack) &&
212212
git verify-pack -v "$pack" >have &&
213213
awk "/blob/ { print \$1 }" <have >blobs &&

t/lib-diff-alternative.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ EOF
131131
'
132132

133133
test_expect_success "diff from attributes with bare repo with source" '
134-
git -C bare.git --attr-source=branchA -c diff.driver.algorithm=myers \
134+
git --git-dir=bare.git --attr-source=branchA -c diff.driver.algorithm=myers \
135135
-c diff.driverA.algorithm=$STRATEGY \
136136
diff HEAD:file1 HEAD:file2 >output &&
137137
test_cmp expect output
138138
'
139139

140140
test_expect_success "diff from attributes with bare repo with invalid source" '
141-
test_must_fail git -C bare.git --attr-source=invalid-branch diff \
141+
test_must_fail git --git-dir=bare.git --attr-source=invalid-branch diff \
142142
HEAD:file1 HEAD:file2
143143
'
144144

t/lib-proto-disable.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test_allow_var () {
1717

1818
test_expect_success "fetch $desc (enabled)" '
1919
(
20-
cd tmp.git &&
20+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
2121
GIT_ALLOW_PROTOCOL=$proto &&
2222
export GIT_ALLOW_PROTOCOL &&
2323
git fetch
@@ -26,7 +26,7 @@ test_allow_var () {
2626

2727
test_expect_success "push $desc (enabled)" '
2828
(
29-
cd tmp.git &&
29+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
3030
GIT_ALLOW_PROTOCOL=$proto &&
3131
export GIT_ALLOW_PROTOCOL &&
3232
git push origin HEAD:pushed
@@ -35,7 +35,7 @@ test_allow_var () {
3535

3636
test_expect_success "push $desc (disabled)" '
3737
(
38-
cd tmp.git &&
38+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
3939
GIT_ALLOW_PROTOCOL=none &&
4040
export GIT_ALLOW_PROTOCOL &&
4141
test_must_fail git push origin HEAD:pushed
@@ -44,7 +44,7 @@ test_allow_var () {
4444

4545
test_expect_success "fetch $desc (disabled)" '
4646
(
47-
cd tmp.git &&
47+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
4848
GIT_ALLOW_PROTOCOL=none &&
4949
export GIT_ALLOW_PROTOCOL &&
5050
test_must_fail git fetch
@@ -83,19 +83,19 @@ test_config () {
8383
'
8484

8585
test_expect_success "fetch $desc (enabled)" '
86-
git -C tmp.git -c protocol.$proto.allow=always fetch
86+
git --git-dir=tmp.git -c protocol.$proto.allow=always fetch
8787
'
8888

8989
test_expect_success "push $desc (enabled)" '
90-
git -C tmp.git -c protocol.$proto.allow=always push origin HEAD:pushed
90+
git --git-dir=tmp.git -c protocol.$proto.allow=always push origin HEAD:pushed
9191
'
9292

9393
test_expect_success "push $desc (disabled)" '
94-
test_must_fail git -C tmp.git -c protocol.$proto.allow=never push origin HEAD:pushed
94+
test_must_fail git --git-dir=tmp.git -c protocol.$proto.allow=never push origin HEAD:pushed
9595
'
9696

9797
test_expect_success "fetch $desc (disabled)" '
98-
test_must_fail git -C tmp.git -c protocol.$proto.allow=never fetch
98+
test_must_fail git --git-dir=tmp.git -c protocol.$proto.allow=never fetch
9999
'
100100

101101
test_expect_success "clone $desc (disabled)" '
@@ -110,16 +110,16 @@ test_config () {
110110
'
111111

112112
test_expect_success "fetch $desc (enabled)" '
113-
git -C tmp.git -c protocol.$proto.allow=user fetch
113+
git --git-dir=tmp.git -c protocol.$proto.allow=user fetch
114114
'
115115

116116
test_expect_success "push $desc (enabled)" '
117-
git -C tmp.git -c protocol.$proto.allow=user push origin HEAD:pushed
117+
git --git-dir=tmp.git -c protocol.$proto.allow=user push origin HEAD:pushed
118118
'
119119

120120
test_expect_success "push $desc (disabled)" '
121121
(
122-
cd tmp.git &&
122+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
123123
GIT_PROTOCOL_FROM_USER=0 &&
124124
export GIT_PROTOCOL_FROM_USER &&
125125
test_must_fail git -c protocol.$proto.allow=user push origin HEAD:pushed
@@ -128,7 +128,7 @@ test_config () {
128128

129129
test_expect_success "fetch $desc (disabled)" '
130130
(
131-
cd tmp.git &&
131+
cd tmp.git && GIT_DIR=. && export GIT_DIR &&
132132
GIT_PROTOCOL_FROM_USER=0 &&
133133
export GIT_PROTOCOL_FROM_USER &&
134134
test_must_fail git -c protocol.$proto.allow=user fetch
@@ -153,22 +153,22 @@ test_config () {
153153

154154
test_expect_success "fetch $desc (enabled)" '
155155
test_config_global protocol.allow always &&
156-
git -C tmp.git fetch
156+
git --git-dir=tmp.git fetch
157157
'
158158

159159
test_expect_success "push $desc (enabled)" '
160160
test_config_global protocol.allow always &&
161-
git -C tmp.git push origin HEAD:pushed
161+
git --git-dir=tmp.git push origin HEAD:pushed
162162
'
163163

164164
test_expect_success "push $desc (disabled)" '
165165
test_config_global protocol.allow never &&
166-
test_must_fail git -C tmp.git push origin HEAD:pushed
166+
test_must_fail git --git-dir=tmp.git push origin HEAD:pushed
167167
'
168168

169169
test_expect_success "fetch $desc (disabled)" '
170170
test_config_global protocol.allow never &&
171-
test_must_fail git -C tmp.git fetch
171+
test_must_fail git --git-dir=tmp.git fetch
172172
'
173173

174174
test_expect_success "clone $desc (disabled)" '

t/t0001-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ test_expect_success 'bare & --separate-git-dir incompatible within worktree' '
347347
test_when_finished "rm -rf bare.git linkwt seprepo" &&
348348
test_commit gumby &&
349349
git clone --bare . bare.git &&
350-
git -C bare.git worktree add --detach ../linkwt &&
350+
git --git-dir=bare.git worktree add --detach linkwt &&
351351
test_must_fail git -C linkwt init --separate-git-dir seprepo 2>err &&
352352
test_grep "incompatible" err
353353
'

t/t0003-attributes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@ test_expect_success 'bare repo no longer defaults to reading .gitattributes from
401401
git clone --bare test bare_with_gitattribute &&
402402
403403
echo "f/path: test: unspecified" >expect &&
404-
git -C bare_with_gitattribute check-attr test -- f/path >actual &&
404+
git --git-dir=bare_with_gitattribute check-attr test -- f/path >actual &&
405405
test_cmp expect actual &&
406406
407407
echo "f/path: test: val" >expect &&
408-
git -C bare_with_gitattribute -c attr.tree=HEAD \
408+
git --git-dir=bare_with_gitattribute -c attr.tree=HEAD \
409409
check-attr test -- f/path >actual &&
410410
test_cmp expect actual
411411
'

t/t0410-partial-clone.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,10 @@ test_expect_success 'exact rename does not need to fetch the blob lazily' '
643643
test_config -C repo uploadpack.allowanysha1inwant 1 &&
644644
645645
git clone --filter=blob:none --bare "file://$(pwd)/repo" partial.git &&
646-
git -C partial.git rev-list --objects --missing=print HEAD >out &&
646+
git --git-dir=partial.git rev-list --objects --missing=print HEAD >out &&
647647
grep "[?]$FILE_HASH" out &&
648-
git -C partial.git log --follow -- new-file.txt &&
649-
git -C partial.git rev-list --objects --missing=print HEAD >out &&
648+
git --git-dir=partial.git log --follow -- new-file.txt &&
649+
git --git-dir=partial.git rev-list --objects --missing=print HEAD >out &&
650650
grep "[?]$FILE_HASH" out
651651
'
652652

@@ -661,30 +661,30 @@ test_expect_success 'lazy-fetch when accessing object not in the_repository' '
661661
FILE_HASH=$(git -C full rev-parse HEAD:file.txt) &&
662662
663663
# Sanity check that the file is missing
664-
git -C partial.git rev-list --objects --missing=print HEAD >out &&
664+
git --git-dir=partial.git rev-list --objects --missing=print HEAD >out &&
665665
grep "[?]$FILE_HASH" out &&
666666
667667
# The no-lazy-fetch mechanism prevents Git from fetching
668668
test_must_fail env GIT_NO_LAZY_FETCH=1 \
669-
git -C partial.git cat-file -e "$FILE_HASH" &&
669+
git --git-dir=partial.git cat-file -e "$FILE_HASH" &&
670670
671671
# The same with command line option to "git"
672-
test_must_fail git --no-lazy-fetch -C partial.git cat-file -e "$FILE_HASH" &&
672+
test_must_fail git --no-lazy-fetch --git-dir=partial.git cat-file -e "$FILE_HASH" &&
673673
674674
# The same, forcing a subprocess via an alias
675-
test_must_fail git --no-lazy-fetch -C partial.git \
675+
test_must_fail git --no-lazy-fetch --git-dir=partial.git \
676676
-c alias.foo="!git cat-file" foo -e "$FILE_HASH" &&
677677
678678
# Sanity check that the file is still missing
679-
git -C partial.git rev-list --objects --missing=print HEAD >out &&
679+
git --git-dir=partial.git rev-list --objects --missing=print HEAD >out &&
680680
grep "[?]$FILE_HASH" out &&
681681
682682
git -C full cat-file -s "$FILE_HASH" >expect &&
683683
test-tool partial-clone object-info partial.git "$FILE_HASH" >actual &&
684684
test_cmp expect actual &&
685685
686686
# Sanity check that the file is now present
687-
git -C partial.git rev-list --objects --missing=print HEAD >out &&
687+
git --git-dir=partial.git rev-list --objects --missing=print HEAD >out &&
688688
! grep "[?]$FILE_HASH" out
689689
'
690690

t/t0600-reffiles-backend.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ test_expect_success SYMLINKS 'git branch -m with symlinked .git/refs' '
428428
ln -s ../.git/objects subdir/objects &&
429429
ln -s ../.git/packed-refs subdir/packed-refs &&
430430
431-
git -C subdir rev-parse --absolute-git-dir >subdir.dir &&
431+
git --git-dir=subdir rev-parse --absolute-git-dir >subdir.dir &&
432432
git rev-parse --absolute-git-dir >our.dir &&
433433
! test_cmp subdir.dir our.dir &&
434434
435-
git -C subdir log &&
436-
git -C subdir branch rename-src &&
435+
git --git-dir=subdir log &&
436+
git --git-dir=subdir branch rename-src &&
437437
git rev-parse rename-src >expect &&
438-
git -C subdir branch -m rename-src rename-dest &&
438+
git --git-dir=subdir branch -m rename-src rename-dest &&
439439
git rev-parse rename-dest >actual &&
440440
test_cmp expect actual &&
441441
git branch -D rename-dest

t/t1006-cat-file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ test_expect_success 'clean up broken objects' '
804804
test_expect_success 'cat-file -t and -s on corrupt loose object' '
805805
git init --bare corrupt-loose.git &&
806806
(
807-
cd corrupt-loose.git &&
807+
cd corrupt-loose.git && GIT_DIR=. && export GIT_DIR &&
808808
809809
# Setup and create the empty blob and its path
810810
empty_path=$(git rev-parse --git-path objects/$(test_oid_to_path "$EMPTY_BLOB")) &&

t/t1022-read-tree-partial-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_expect_success 'read-tree in partial clone prefetches in one batch' '
1818
git -C server config uploadpack.allowfilter 1 &&
1919
git -C server config uploadpack.allowanysha1inwant 1 &&
2020
git clone --bare --filter=blob:none "file://$(pwd)/server" client &&
21-
GIT_TRACE_PACKET="$(pwd)/trace" git -C client read-tree $TREE $TREE &&
21+
GIT_TRACE_PACKET="$(pwd)/trace" git --git-dir=client read-tree $TREE $TREE &&
2222
2323
# "done" marks the end of negotiation (once per fetch). Expect that
2424
# only one fetch occurs.

0 commit comments

Comments
 (0)