File tree Expand file tree Collapse file tree 2 files changed +63
-53
lines changed Expand file tree Collapse file tree 2 files changed +63
-53
lines changed Original file line number Diff line number Diff line change @@ -1118,59 +1118,6 @@ test_expect_success 'fetching with auto-gc does not lock up' '
1118
1118
)
1119
1119
'
1120
1120
1121
- test_expect_success ' fetch aligned output' '
1122
- git clone . full-output &&
1123
- test_commit looooooooooooong-tag &&
1124
- (
1125
- cd full-output &&
1126
- git -c fetch.output=full fetch origin >actual 2>&1 &&
1127
- grep -e "->" actual | cut -c 22- >../actual
1128
- ) &&
1129
- cat >expect <<-\EOF &&
1130
- main -> origin/main
1131
- looooooooooooong-tag -> looooooooooooong-tag
1132
- EOF
1133
- test_cmp expect actual
1134
- '
1135
-
1136
- test_expect_success ' fetch compact output' '
1137
- git clone . compact &&
1138
- test_commit extraaa &&
1139
- (
1140
- cd compact &&
1141
- git -c fetch.output=compact fetch origin >actual 2>&1 &&
1142
- grep -e "->" actual | cut -c 22- >../actual
1143
- ) &&
1144
- cat >expect <<-\EOF &&
1145
- main -> origin/*
1146
- extraaa -> *
1147
- EOF
1148
- test_cmp expect actual
1149
- '
1150
-
1151
- test_expect_success ' --no-show-forced-updates' '
1152
- mkdir forced-updates &&
1153
- (
1154
- cd forced-updates &&
1155
- git init &&
1156
- test_commit 1 &&
1157
- test_commit 2
1158
- ) &&
1159
- git clone forced-updates forced-update-clone &&
1160
- git clone forced-updates no-forced-update-clone &&
1161
- git -C forced-updates reset --hard HEAD~1 &&
1162
- (
1163
- cd forced-update-clone &&
1164
- git fetch --show-forced-updates origin 2>output &&
1165
- test_i18ngrep "(forced update)" output
1166
- ) &&
1167
- (
1168
- cd no-forced-update-clone &&
1169
- git fetch --no-show-forced-updates origin 2>output &&
1170
- test_i18ngrep ! "(forced update)" output
1171
- )
1172
- '
1173
-
1174
1121
for section in fetch transfer
1175
1122
do
1176
1123
test_expect_success " $section .hideRefs affects connectivity check" '
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ test_description=' git fetch output format'
4
+
5
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
+ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
+
8
+ . ./test-lib.sh
9
+
10
+ test_expect_success ' fetch aligned output' '
11
+ git clone . full-output &&
12
+ test_commit looooooooooooong-tag &&
13
+ (
14
+ cd full-output &&
15
+ git -c fetch.output=full fetch origin >actual 2>&1 &&
16
+ grep -e "->" actual | cut -c 22- >../actual
17
+ ) &&
18
+ cat >expect <<-\EOF &&
19
+ main -> origin/main
20
+ looooooooooooong-tag -> looooooooooooong-tag
21
+ EOF
22
+ test_cmp expect actual
23
+ '
24
+
25
+ test_expect_success ' fetch compact output' '
26
+ git clone . compact &&
27
+ test_commit extraaa &&
28
+ (
29
+ cd compact &&
30
+ git -c fetch.output=compact fetch origin >actual 2>&1 &&
31
+ grep -e "->" actual | cut -c 22- >../actual
32
+ ) &&
33
+ cat >expect <<-\EOF &&
34
+ main -> origin/*
35
+ extraaa -> *
36
+ EOF
37
+ test_cmp expect actual
38
+ '
39
+
40
+ test_expect_success ' --no-show-forced-updates' '
41
+ mkdir forced-updates &&
42
+ (
43
+ cd forced-updates &&
44
+ git init &&
45
+ test_commit 1 &&
46
+ test_commit 2
47
+ ) &&
48
+ git clone forced-updates forced-update-clone &&
49
+ git clone forced-updates no-forced-update-clone &&
50
+ git -C forced-updates reset --hard HEAD~1 &&
51
+ (
52
+ cd forced-update-clone &&
53
+ git fetch --show-forced-updates origin 2>output &&
54
+ test_i18ngrep "(forced update)" output
55
+ ) &&
56
+ (
57
+ cd no-forced-update-clone &&
58
+ git fetch --no-show-forced-updates origin 2>output &&
59
+ test_i18ngrep ! "(forced update)" output
60
+ )
61
+ '
62
+
63
+ test_done
You can’t perform that action at this time.
0 commit comments