diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-07-07 10:25:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-07 10:25:15 -0700 |
commit | 56bfacef7966553530532d58c07787754add2465 (patch) | |
tree | 3e56ab8a4fe42fee53571fb6f7d5fee7ec19252e /t | |
parent | 765c22588d9e410bf0100c4991b1945134da6959 (diff) | |
parent | 0e71bc300432b9e63bdbc8e28b0c5c0fafb601fc (diff) | |
download | git-56bfacef7966553530532d58c07787754add2465.tar.gz |
Merge branch 'tr/receive-pack-aliased-update-fix' into maint
* tr/receive-pack-aliased-update-fix:
check_aliased_update: strcpy() instead of strcat() to copy
receive-pack: detect aliased updates which can occur with symrefs
receive-pack: switch global variable 'commands' to a parameter
Conflicts:
t/t5516-fetch-push.sh
Diffstat (limited to 't')
-rwxr-xr-x | t/t5516-fetch-push.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 6a37a4d993..b8f64e1386 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -660,6 +660,55 @@ test_expect_success 'push with branches containing #' ' git checkout master ' +test_expect_success 'push into aliased refs (consistent)' ' + mk_test heads/master && + mk_child child1 && + mk_child child2 && + ( + cd child1 && + git branch foo && + git symbolic-ref refs/heads/bar refs/heads/foo + git config receive.denyCurrentBranch false + ) && + ( + cd child2 && + >path2 && + git add path2 && + test_tick && + git commit -a -m child2 && + git branch foo && + git branch bar && + git push ../child1 foo bar + ) +' + +test_expect_success 'push into aliased refs (inconsistent)' ' + mk_test heads/master && + mk_child child1 && + mk_child child2 && + ( + cd child1 && + git branch foo && + git symbolic-ref refs/heads/bar refs/heads/foo + git config receive.denyCurrentBranch false + ) && + ( + cd child2 && + >path2 && + git add path2 && + test_tick && + git commit -a -m child2 && + git branch foo && + >path3 && + git add path3 && + test_tick && + git commit -a -m child2 && + git branch bar && + test_must_fail git push ../child1 foo bar 2>stderr && + grep "refusing inconsistent update" stderr + ) +' + test_expect_success 'push --porcelain' ' mk_empty && echo >.git/foo "To testrepo" && |