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()
This commit is contained in:
commit
27b4070e40
@ -68,7 +68,8 @@ HOW MERGE WORKS
|
|||||||
---------------
|
---------------
|
||||||
|
|
||||||
A merge is always between the current `HEAD` and one or more
|
A merge is always between the current `HEAD` and one or more
|
||||||
remote branch heads, and the index file must exactly match the
|
commits (usually, branch head or tag), and the index file must
|
||||||
|
exactly match the
|
||||||
tree of `HEAD` commit (i.e. the contents of the last commit) when
|
tree of `HEAD` commit (i.e. the contents of the last commit) when
|
||||||
it happens. In other words, `git-diff --cached HEAD` must
|
it happens. In other words, `git-diff --cached HEAD` must
|
||||||
report no changes.
|
report no changes.
|
||||||
|
@ -94,11 +94,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
|
|||||||
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
|
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
|
||||||
|
|
||||||
ref = transport_get_remote_refs(transport);
|
ref = transport_get_remote_refs(transport);
|
||||||
transport_disconnect(transport);
|
if (transport_disconnect(transport))
|
||||||
|
|
||||||
if (!ref)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for ( ; ref; ref = ref->next) {
|
for ( ; ref; ref = ref->next) {
|
||||||
if (!check_ref_type(ref, flags))
|
if (!check_ref_type(ref, flags))
|
||||||
continue;
|
continue;
|
||||||
|
17
git-merge.sh
17
git-merge.sh
@ -37,6 +37,7 @@ use_strategies=
|
|||||||
|
|
||||||
allow_fast_forward=t
|
allow_fast_forward=t
|
||||||
allow_trivial_merge=t
|
allow_trivial_merge=t
|
||||||
|
squash= no_commit=
|
||||||
|
|
||||||
dropsave() {
|
dropsave() {
|
||||||
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
|
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
|
||||||
@ -152,17 +153,21 @@ parse_config () {
|
|||||||
--summary)
|
--summary)
|
||||||
show_diffstat=t ;;
|
show_diffstat=t ;;
|
||||||
--squash)
|
--squash)
|
||||||
allow_fast_forward=t squash=t no_commit=t ;;
|
test "$allow_fast_forward" = t ||
|
||||||
|
die "You cannot combine --squash with --no-ff."
|
||||||
|
squash=t no_commit=t ;;
|
||||||
--no-squash)
|
--no-squash)
|
||||||
allow_fast_forward=t squash= no_commit= ;;
|
squash= no_commit= ;;
|
||||||
--commit)
|
--commit)
|
||||||
allow_fast_forward=t squash= no_commit= ;;
|
no_commit= ;;
|
||||||
--no-commit)
|
--no-commit)
|
||||||
allow_fast_forward=t squash= no_commit=t ;;
|
no_commit=t ;;
|
||||||
--ff)
|
--ff)
|
||||||
allow_fast_forward=t squash= no_commit= ;;
|
allow_fast_forward=t ;;
|
||||||
--no-ff)
|
--no-ff)
|
||||||
allow_fast_forward=false squash= no_commit= ;;
|
test "$squash" != t ||
|
||||||
|
die "You cannot combine --squash with --no-ff."
|
||||||
|
allow_fast_forward=f ;;
|
||||||
-s|--strategy)
|
-s|--strategy)
|
||||||
shift
|
shift
|
||||||
case " $all_strategies " in
|
case " $all_strategies " in
|
||||||
|
14
http.c
14
http.c
@ -284,23 +284,15 @@ void http_init(struct remote *remote)
|
|||||||
void http_cleanup(void)
|
void http_cleanup(void)
|
||||||
{
|
{
|
||||||
struct active_request_slot *slot = active_queue_head;
|
struct active_request_slot *slot = active_queue_head;
|
||||||
#ifdef USE_CURL_MULTI
|
|
||||||
char *wait_url;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (slot != NULL) {
|
while (slot != NULL) {
|
||||||
struct active_request_slot *next = slot->next;
|
struct active_request_slot *next = slot->next;
|
||||||
|
if (slot->curl != NULL) {
|
||||||
#ifdef USE_CURL_MULTI
|
#ifdef USE_CURL_MULTI
|
||||||
if (slot->in_use) {
|
curl_multi_remove_handle(curlm, slot->curl);
|
||||||
curl_easy_getinfo(slot->curl,
|
|
||||||
CURLINFO_EFFECTIVE_URL,
|
|
||||||
&wait_url);
|
|
||||||
fprintf(stderr, "Waiting for %s\n", wait_url);
|
|
||||||
run_active_slot(slot);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (slot->curl != NULL)
|
|
||||||
curl_easy_cleanup(slot->curl);
|
curl_easy_cleanup(slot->curl);
|
||||||
|
}
|
||||||
free(slot);
|
free(slot);
|
||||||
slot = next;
|
slot = next;
|
||||||
}
|
}
|
||||||
|
@ -419,6 +419,7 @@ test_debug 'gitk --all'
|
|||||||
|
|
||||||
test_expect_success 'merge c0 with c1 (no-ff)' '
|
test_expect_success 'merge c0 with c1 (no-ff)' '
|
||||||
git reset --hard c0 &&
|
git reset --hard c0 &&
|
||||||
|
git config branch.master.mergeoptions "" &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
git merge --no-ff c1 &&
|
git merge --no-ff c1 &&
|
||||||
verify_merge file result.1 &&
|
verify_merge file result.1 &&
|
||||||
@ -427,6 +428,11 @@ test_expect_success 'merge c0 with c1 (no-ff)' '
|
|||||||
|
|
||||||
test_debug 'gitk --all'
|
test_debug 'gitk --all'
|
||||||
|
|
||||||
|
test_expect_success 'combining --squash and --no-ff is refused' '
|
||||||
|
test_must_fail git merge --squash --no-ff c1 &&
|
||||||
|
test_must_fail git merge --no-ff --squash c1
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
|
test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
|
||||||
git reset --hard c0 &&
|
git reset --hard c0 &&
|
||||||
git config branch.master.mergeoptions "--no-ff" &&
|
git config branch.master.mergeoptions "--no-ff" &&
|
||||||
|
Loading…
Reference in New Issue
Block a user