diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-27 12:53:26 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-27 12:53:26 -0800 |
commit | 5a4d707a6d914fcea302e299fc18892d9e42c767 (patch) | |
tree | bcca033e39a540aea39acdcb98ef772631fdbc3b /t | |
parent | Merge branch 'db/cover-letter' (diff) | |
parent | checkout: error out when index is unmerged even with -m (diff) | |
download | tgif-5a4d707a6d914fcea302e299fc18892d9e42c767.tar.xz |
Merge branch 'db/checkout'
* db/checkout: (21 commits)
checkout: error out when index is unmerged even with -m
checkout: show progress when checkout takes long time while switching branches
Add merge-subtree back
checkout: updates to tracking report
builtin-checkout.c: Remove unused prefix arguments in switch_branches path
checkout: work from a subdirectory
checkout: tone down the "forked status" diagnostic messages
Clean up reporting differences on branch switch
builtin-checkout.c: fix possible usage segfault
checkout: notice when the switched branch is behind or forked
Build in checkout
Move code to clean up after a branch change to branch.c
Library function to check for unmerged index entries
Use diff -u instead of diff in t7201
Move create_branch into a library file
Build-in merge-recursive
Add "skip_unmerged" option to unpack_trees.
Discard "deleted" cache entries after using them to update the working tree
Send unpack-trees debugging output to stderr
Add flag to make unpack_trees() not print errors.
...
Conflicts:
Makefile
Diffstat (limited to 't')
-rwxr-xr-x | t/t6029-merge-subtree.sh | 32 | ||||
-rwxr-xr-x | t/t7201-co.sh | 59 |
2 files changed, 75 insertions, 16 deletions
diff --git a/t/t6029-merge-subtree.sh b/t/t6029-merge-subtree.sh new file mode 100755 index 0000000000..3900a05082 --- /dev/null +++ b/t/t6029-merge-subtree.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +test_description='subtree merge strategy' + +. ./test-lib.sh + +test_expect_success setup ' + + s="1 2 3 4 5 6 7 8" + for i in $s; do echo $i; done >hello && + git add hello && + git commit -m initial && + git checkout -b side && + echo >>hello world && + git add hello && + git commit -m second && + git checkout master && + for i in mundo $s; do echo $i; done >hello && + git add hello && + git commit -m master + +' + +test_expect_success 'subtree available and works like recursive' ' + + git merge -s subtree side && + for i in mundo $s world; do echo $i; done >expect && + diff -u expect hello + +' + +test_done diff --git a/t/t7201-co.sh b/t/t7201-co.sh index dbf1ace29e..724adef0bf 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -83,13 +83,13 @@ test_expect_success "checkout with unrelated dirty tree without -m" ' fill 0 1 2 3 4 5 6 7 8 >same && cp same kept git checkout side >messages && - git diff same kept + diff -u same kept (cat > messages.expect <<EOF M same EOF ) && touch messages.expect && - git diff messages.expect messages + diff -u messages.expect messages ' test_expect_success "checkout -m with dirty tree" ' @@ -103,29 +103,22 @@ test_expect_success "checkout -m with dirty tree" ' test "$(git symbolic-ref HEAD)" = "refs/heads/side" && (cat >expect.messages <<EOF -Merging side with local -Merging: -ab76817 Side M one, D two, A three -virtual local -found 1 common ancestor(s): -7329388 Initial A one, A two -Auto-merged one M one EOF ) && - git diff expect.messages messages && + diff -u expect.messages messages && fill "M one" "A three" "D two" >expect.master && git diff --name-status master >current.master && - diff expect.master current.master && + diff -u expect.master current.master && fill "M one" >expect.side && git diff --name-status side >current.side && - diff expect.side current.side && + diff -u expect.side current.side && : >expect.index && git diff --cached >current.index && - diff expect.index current.index + diff -u expect.index current.index ' test_expect_success "checkout -m with dirty tree, renamed" ' @@ -143,7 +136,7 @@ test_expect_success "checkout -m with dirty tree, renamed" ' git checkout -m renamer && fill 1 3 4 5 7 8 >expect && - diff expect uno && + diff -u expect uno && ! test -f one && git diff --cached >current && ! test -s current @@ -168,7 +161,7 @@ test_expect_success 'checkout -m with merge conflict' ' git diff master:one :3:uno | sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current && fill d2 aT d7 aS >expect && - diff current expect && + diff -u current expect && git diff --cached two >current && ! test -s current ' @@ -185,7 +178,7 @@ If you want to create a new branch from this checkout, you may do so HEAD is now at 7329388... Initial A one, A two EOF ) && - git diff messages.expect messages && + diff -u messages.expect messages && H=$(git rev-parse --verify HEAD) && M=$(git show-ref -s --verify refs/heads/master) && test "z$H" = "z$M" && @@ -286,4 +279,38 @@ test_expect_success 'checkout with ambiguous tag/branch names' ' ' +test_expect_success 'switch branches while in subdirectory' ' + + git reset --hard && + git checkout master && + + mkdir subs && + ( + cd subs && + git checkout side + ) && + ! test -f subs/one && + rm -fr subs + +' + +test_expect_success 'checkout specific path while in subdirectory' ' + + git reset --hard && + git checkout side && + mkdir subs && + >subs/bero && + git add subs/bero && + git commit -m "add subs/bero" && + + git checkout master && + mkdir -p subs && + ( + cd subs && + git checkout side -- bero + ) && + test -f subs/bero + +' + test_done |