Skip to content

Commit 27b4070

Browse files
committed
Merge branch 'maint'
* maint: Fix 'git remote show' regression on empty repository in 1.5.4 Fix incorrect wording in git-merge.txt. git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options Fix random crashes in http_cleanup()
2 parents 4947cf9 + 52dce39 commit 27b4070

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

Documentation/git-merge.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ HOW MERGE WORKS
6868
---------------
6969

7070
A merge is always between the current `HEAD` and one or more
71-
remote branch heads, and the index file must exactly match the
71+
commits (usually, branch head or tag), and the index file must
72+
exactly match the
7273
tree of `HEAD` commit (i.e. the contents of the last commit) when
7374
it happens. In other words, `git-diff --cached HEAD` must
7475
report no changes.

builtin-ls-remote.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
9494
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
9595

9696
ref = transport_get_remote_refs(transport);
97-
transport_disconnect(transport);
98-
99-
if (!ref)
97+
if (transport_disconnect(transport))
10098
return 1;
101-
10299
for ( ; ref; ref = ref->next) {
103100
if (!check_ref_type(ref, flags))
104101
continue;

git-merge.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use_strategies=
3737

3838
allow_fast_forward=t
3939
allow_trivial_merge=t
40+
squash= no_commit=
4041

4142
dropsave() {
4243
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@ -152,17 +153,21 @@ parse_config () {
152153
--summary)
153154
show_diffstat=t ;;
154155
--squash)
155-
allow_fast_forward=t squash=t no_commit=t ;;
156+
test "$allow_fast_forward" = t ||
157+
die "You cannot combine --squash with --no-ff."
158+
squash=t no_commit=t ;;
156159
--no-squash)
157-
allow_fast_forward=t squash= no_commit= ;;
160+
squash= no_commit= ;;
158161
--commit)
159-
allow_fast_forward=t squash= no_commit= ;;
162+
no_commit= ;;
160163
--no-commit)
161-
allow_fast_forward=t squash= no_commit=t ;;
164+
no_commit=t ;;
162165
--ff)
163-
allow_fast_forward=t squash= no_commit= ;;
166+
allow_fast_forward=t ;;
164167
--no-ff)
165-
allow_fast_forward=false squash= no_commit= ;;
168+
test "$squash" != t ||
169+
die "You cannot combine --squash with --no-ff."
170+
allow_fast_forward=f ;;
166171
-s|--strategy)
167172
shift
168173
case " $all_strategies " in

http.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,23 +284,15 @@ void http_init(struct remote *remote)
284284
void http_cleanup(void)
285285
{
286286
struct active_request_slot *slot = active_queue_head;
287-
#ifdef USE_CURL_MULTI
288-
char *wait_url;
289-
#endif
290287

291288
while (slot != NULL) {
292289
struct active_request_slot *next = slot->next;
290+
if (slot->curl != NULL) {
293291
#ifdef USE_CURL_MULTI
294-
if (slot->in_use) {
295-
curl_easy_getinfo(slot->curl,
296-
CURLINFO_EFFECTIVE_URL,
297-
&wait_url);
298-
fprintf(stderr, "Waiting for %s\n", wait_url);
299-
run_active_slot(slot);
300-
}
292+
curl_multi_remove_handle(curlm, slot->curl);
301293
#endif
302-
if (slot->curl != NULL)
303294
curl_easy_cleanup(slot->curl);
295+
}
304296
free(slot);
305297
slot = next;
306298
}

t/t7600-merge.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ test_debug 'gitk --all'
419419

420420
test_expect_success 'merge c0 with c1 (no-ff)' '
421421
git reset --hard c0 &&
422+
git config branch.master.mergeoptions "" &&
422423
test_tick &&
423424
git merge --no-ff c1 &&
424425
verify_merge file result.1 &&
@@ -427,6 +428,11 @@ test_expect_success 'merge c0 with c1 (no-ff)' '
427428

428429
test_debug 'gitk --all'
429430

431+
test_expect_success 'combining --squash and --no-ff is refused' '
432+
test_must_fail git merge --squash --no-ff c1 &&
433+
test_must_fail git merge --no-ff --squash c1
434+
'
435+
430436
test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
431437
git reset --hard c0 &&
432438
git config branch.master.mergeoptions "--no-ff" &&

0 commit comments

Comments
 (0)