diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-09 00:29:11 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-09 00:29:11 +0300 |
commit | d04aa7ec4738f90220b9e205326f17938b8f89d4 (patch) | |
tree | 7be435da616d58dec183f8c6c8f1517819a2a626 /t/t5500-fetch-pack.sh | |
parent | 72d917a7f9a5123ef7c0d6db306bbc0d385227e2 (diff) | |
parent | e379fdf34fee96cd205be83ff4e71699bdc32b18 (diff) |
Merge branch 'jc/merge-refuse-new-root'
"git merge" used to allow merging two branches that have no common
base by default, which led to a brand new history of an existing
project created and then get pulled by an unsuspecting maintainer,
which allowed an unnecessary parallel history merged into the
existing project. The command has been taught not to allow this by
default, with an escape hatch "--allow-unrelated-histories" option
to be used in a rare event that merges histories of two projects
that started their lives independently.
* jc/merge-refuse-new-root:
merge: refuse to create too cool a merge by default
Diffstat (limited to 't/t5500-fetch-pack.sh')
-rwxr-xr-x | t/t5500-fetch-pack.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 9b9bec468a..91a69fc33a 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -259,7 +259,8 @@ test_expect_success 'clone shallow object count' ' test_expect_success 'pull in shallow repo with missing merge base' ' ( cd shallow && - test_must_fail git pull --depth 4 .. A + git fetch --depth 4 .. A + test_must_fail git merge --allow-unrelated-histories FETCH_HEAD ) ' @@ -279,9 +280,10 @@ test_expect_success 'clone shallow depth count' ' test_expect_success 'clone shallow object count' ' ( cd shallow && + git prune && git count-objects -v ) > count.shallow && - grep "^count: 55" count.shallow + grep "^count: 54" count.shallow ' test_expect_success 'fetch --no-shallow on full repo' ' |