File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1883,6 +1883,8 @@ static void add_options_to_argv(struct strvec *argv)
1883
1883
strvec_push (argv , "--ipv4" );
1884
1884
else if (family == TRANSPORT_FAMILY_IPV6 )
1885
1885
strvec_push (argv , "--ipv6" );
1886
+ if (!write_fetch_head )
1887
+ strvec_push (argv , "--no-write-fetch-head" );
1886
1888
}
1887
1889
1888
1890
/* Fetch multiple remotes in parallel */
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ test_expect_success 'git fetch --all' '
58
58
test_cmp expect output)
59
59
'
60
60
61
+ test_expect_success ' git fetch --all --no-write-fetch-head' '
62
+ (cd test &&
63
+ rm -f .git/FETCH_HEAD &&
64
+ git fetch --all --no-write-fetch-head &&
65
+ test_path_is_missing .git/FETCH_HEAD)
66
+ '
67
+
61
68
test_expect_success ' git fetch --all should continue if a remote has errors' '
62
69
(git clone one test2 &&
63
70
cd test2 &&
Original file line number Diff line number Diff line change @@ -167,6 +167,19 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
167
167
verify_fetch_result actual.err
168
168
'
169
169
170
+ test_expect_success " fetch --recurse-submodules honors --no-write-fetch-head" '
171
+ (
172
+ cd downstream &&
173
+ git submodule foreach --recursive \
174
+ sh -c "cd \"\$(git rev-parse --git-dir)\" && rm -f FETCH_HEAD" &&
175
+
176
+ git fetch --recurse-submodules --no-write-fetch-head &&
177
+
178
+ git submodule foreach --recursive \
179
+ sh -c "cd \"\$(git rev-parse --git-dir)\" && ! test -f FETCH_HEAD"
180
+ )
181
+ '
182
+
170
183
test_expect_success " submodule.recurse option triggers recursive fetch" '
171
184
add_submodule_commits &&
172
185
(
You can’t perform that action at this time.
0 commit comments