Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* 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()
  • Loading branch information
Junio C Hamano committed Mar 4, 2008
2 parents 4947cf9 + 52dce39 commit 27b4070
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
3 changes: 2 additions & 1 deletion Documentation/git-merge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ HOW MERGE WORKS
---------------

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
it happens. In other words, `git-diff --cached HEAD` must
report no changes.
Expand Down
5 changes: 1 addition & 4 deletions builtin-ls-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);

ref = transport_get_remote_refs(transport);
transport_disconnect(transport);

if (!ref)
if (transport_disconnect(transport))
return 1;

for ( ; ref; ref = ref->next) {
if (!check_ref_type(ref, flags))
continue;
Expand Down
17 changes: 11 additions & 6 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use_strategies=

allow_fast_forward=t
allow_trivial_merge=t
squash= no_commit=

dropsave() {
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
Expand Down Expand Up @@ -152,17 +153,21 @@ parse_config () {
--summary)
show_diffstat=t ;;
--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)
allow_fast_forward=t squash= no_commit= ;;
squash= no_commit= ;;
--commit)
allow_fast_forward=t squash= no_commit= ;;
no_commit= ;;
--no-commit)
allow_fast_forward=t squash= no_commit=t ;;
no_commit=t ;;
--ff)
allow_fast_forward=t squash= no_commit= ;;
allow_fast_forward=t ;;
--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)
shift
case " $all_strategies " in
Expand Down
14 changes: 3 additions & 11 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,15 @@ void http_init(struct remote *remote)
void http_cleanup(void)
{
struct active_request_slot *slot = active_queue_head;
#ifdef USE_CURL_MULTI
char *wait_url;
#endif

while (slot != NULL) {
struct active_request_slot *next = slot->next;
if (slot->curl != NULL) {
#ifdef USE_CURL_MULTI
if (slot->in_use) {
curl_easy_getinfo(slot->curl,
CURLINFO_EFFECTIVE_URL,
&wait_url);
fprintf(stderr, "Waiting for %s\n", wait_url);
run_active_slot(slot);
}
curl_multi_remove_handle(curlm, slot->curl);
#endif
if (slot->curl != NULL)
curl_easy_cleanup(slot->curl);
}
free(slot);
slot = next;
}
Expand Down
6 changes: 6 additions & 0 deletions t/t7600-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ test_debug 'gitk --all'

test_expect_success 'merge c0 with c1 (no-ff)' '
git reset --hard c0 &&
git config branch.master.mergeoptions "" &&
test_tick &&
git merge --no-ff c1 &&
verify_merge file result.1 &&
Expand All @@ -427,6 +428,11 @@ test_expect_success 'merge c0 with c1 (no-ff)' '

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)' '
git reset --hard c0 &&
git config branch.master.mergeoptions "--no-ff" &&
Expand Down

0 comments on commit 27b4070

Please sign in to comment.