mirror of
https://github.com/git/git.git
synced 2026-04-04 14:00:10 +02:00
Merge branch 'master' of git://repo.or.cz/alt-git
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
test_description='Two way merge with read-tree -m $H $M
|
||||
|
||||
This test tries two-way merge (aka fast forward with carry forward).
|
||||
This test tries two-way merge (aka fast-forward with carry forward).
|
||||
|
||||
There is the head (called H) and another commit (called M), which is
|
||||
simply ahead of H. The index and the work tree contains a state that
|
||||
@@ -51,7 +51,7 @@ check_cache_at () {
|
||||
}
|
||||
|
||||
cat >bozbar-old <<\EOF
|
||||
This is a sample file used in two-way fast forward merge
|
||||
This is a sample file used in two-way fast-forward merge
|
||||
tests. Its second line ends with a magic word bozbar
|
||||
which will be modified by the merged head to gnusto.
|
||||
It has some extra lines so that external tools can
|
||||
@@ -300,7 +300,7 @@ test_expect_success \
|
||||
echo gnusto gnusto >bozbar &&
|
||||
if read_tree_twoway $treeH $treeM; then false; else :; fi'
|
||||
|
||||
# This fails with straight two-way fast forward.
|
||||
# This fails with straight two-way fast-forward.
|
||||
test_expect_success \
|
||||
'22 - local change cache updated.' \
|
||||
'rm -f .git/index &&
|
||||
|
||||
@@ -29,4 +29,12 @@ test_expect_success 'add file to gitignore' '
|
||||
'
|
||||
check_all_output
|
||||
|
||||
test_expect_success 'ls-files -i lists only tracked-but-ignored files' '
|
||||
echo content >other-file &&
|
||||
git add other-file &&
|
||||
echo file >expect &&
|
||||
git ls-files -i --exclude-standard >output &&
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -228,4 +228,21 @@ test_expect_success 'add first line works' '
|
||||
test_cmp expected diff
|
||||
'
|
||||
|
||||
cat >expected <<EOF
|
||||
diff --git a/empty b/empty
|
||||
deleted file mode 100644
|
||||
index e69de29..0000000
|
||||
EOF
|
||||
|
||||
test_expect_success 'deleting an empty file' '
|
||||
git reset --hard &&
|
||||
> empty &&
|
||||
git add empty &&
|
||||
git commit -m empty &&
|
||||
rm empty &&
|
||||
echo y | git add -p empty &&
|
||||
git diff --cached >diff &&
|
||||
test_cmp expected diff
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -455,6 +455,27 @@ test_expect_success 'format-patch respects -U' '
|
||||
|
||||
'
|
||||
|
||||
cat > expect << EOF
|
||||
|
||||
diff --git a/file b/file
|
||||
index 40f36c6..2dc5c23 100644
|
||||
--- a/file
|
||||
+++ b/file
|
||||
@@ -14,3 +14,19 @@ C
|
||||
D
|
||||
E
|
||||
F
|
||||
+5
|
||||
EOF
|
||||
|
||||
test_expect_success 'format-patch -p suppresses stat' '
|
||||
|
||||
git format-patch -p -2 &&
|
||||
sed -e "1,/^$/d" -e "/^+5/q" < 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch > output &&
|
||||
test_cmp expect output
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'format-patch from a subdirectory (1)' '
|
||||
filename=$(
|
||||
rm -rf sub &&
|
||||
|
||||
@@ -63,6 +63,26 @@ test_expect_success 'word diff with runs of whitespace' '
|
||||
|
||||
'
|
||||
|
||||
cat > expect <<\EOF
|
||||
<WHITE>diff --git a/pre b/post<RESET>
|
||||
<WHITE>index 330b04f..5ed8eff 100644<RESET>
|
||||
<WHITE>--- a/pre<RESET>
|
||||
<WHITE>+++ b/post<RESET>
|
||||
<BROWN>@@ -1 +1 @@<RESET>
|
||||
<RED>h(4)<RESET><GREEN>h(4),hh[44]<RESET>
|
||||
<BROWN>@@ -3,0 +4,4 @@ a = b + c<RESET>
|
||||
|
||||
<GREEN>aa = a<RESET>
|
||||
|
||||
<GREEN>aeff = aeff * ( aaa )<RESET>
|
||||
EOF
|
||||
|
||||
test_expect_success 'word diff without context' '
|
||||
|
||||
word_diff --color-words --unified=0
|
||||
|
||||
'
|
||||
|
||||
cat > expect <<\EOF
|
||||
<WHITE>diff --git a/pre b/post<RESET>
|
||||
<WHITE>index 330b04f..5ed8eff 100644<RESET>
|
||||
|
||||
@@ -158,7 +158,7 @@ cat > test/expect << EOF
|
||||
another
|
||||
master
|
||||
Local refs configured for 'git push':
|
||||
ahead forces to master (fast forwardable)
|
||||
ahead forces to master (fast-forwardable)
|
||||
master pushes to another (up to date)
|
||||
EOF
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ test_expect_success setup '
|
||||
git commit -a -m next
|
||||
'
|
||||
|
||||
test_expect_success 'non fast forward fetch' '
|
||||
test_expect_success 'non-fast-forward fetch' '
|
||||
|
||||
test_must_fail git fetch . master:side
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='merge fast forward and up to date'
|
||||
test_description='merge fast-forward and up to date'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
|
||||
@@ -125,6 +125,20 @@ test_expect_success 'rename tag Q back to A' '
|
||||
test_expect_success 'pack tag refs' 'git pack-refs'
|
||||
check_describe A-* HEAD
|
||||
|
||||
check_describe "A-*[0-9a-f]" --dirty
|
||||
|
||||
test_expect_success 'set-up dirty work tree' '
|
||||
echo >>file
|
||||
'
|
||||
|
||||
check_describe "A-*[0-9a-f]-dirty" --dirty
|
||||
|
||||
check_describe "A-*[0-9a-f].mod" --dirty=.mod
|
||||
|
||||
test_expect_success 'describe --dirty HEAD' '
|
||||
test_must_fail git describe --dirty HEAD
|
||||
'
|
||||
|
||||
test_expect_success 'set-up matching pattern tests' '
|
||||
git tag -a -m test-annotated test-annotated &&
|
||||
echo >>file &&
|
||||
|
||||
@@ -258,4 +258,13 @@ test_expect_success 'Hand committing of a redundant merge removes dups' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'A single-liner subject with a token plus colon is not a footer' '
|
||||
|
||||
git reset --hard &&
|
||||
git commit -s -m "hello: kitty" --allow-empty &&
|
||||
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
|
||||
test $(wc -l <actual) = 3
|
||||
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -243,6 +243,16 @@ test_expect_success 'merge c0 with c1' '
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'merge c0 with c1 with --ff-only' '
|
||||
git reset --hard c0 &&
|
||||
git merge --ff-only c1 &&
|
||||
git merge --ff-only HEAD c0 c1 &&
|
||||
verify_merge file result.1 &&
|
||||
verify_head "$c1"
|
||||
'
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'merge c1 with c2' '
|
||||
git reset --hard c1 &&
|
||||
test_tick &&
|
||||
@@ -263,6 +273,14 @@ test_expect_success 'merge c1 with c2 and c3' '
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'failing merges with --ff-only' '
|
||||
git reset --hard c1 &&
|
||||
test_tick &&
|
||||
test_must_fail git merge --ff-only c2 &&
|
||||
test_must_fail git merge --ff-only c3 &&
|
||||
test_must_fail git merge --ff-only c2 c3
|
||||
'
|
||||
|
||||
test_expect_success 'merge c0 with c1 (no-commit)' '
|
||||
git reset --hard c0 &&
|
||||
git merge --no-commit c1 &&
|
||||
@@ -303,6 +321,17 @@ test_expect_success 'merge c0 with c1 (squash)' '
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'merge c0 with c1 (squash, ff-only)' '
|
||||
git reset --hard c0 &&
|
||||
git merge --squash --ff-only c1 &&
|
||||
verify_merge file result.1 &&
|
||||
verify_head $c0 &&
|
||||
verify_no_mergehead &&
|
||||
verify_diff squash.1 .git/SQUASH_MSG "[OOPS] bad squash message"
|
||||
'
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'merge c1 with c2 (squash)' '
|
||||
git reset --hard c1 &&
|
||||
git merge --squash c2 &&
|
||||
@@ -314,6 +343,13 @@ test_expect_success 'merge c1 with c2 (squash)' '
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'unsuccesful merge of c1 with c2 (squash, ff-only)' '
|
||||
git reset --hard c1 &&
|
||||
test_must_fail git merge --squash --ff-only c2
|
||||
'
|
||||
|
||||
test_debug 'gitk --all'
|
||||
|
||||
test_expect_success 'merge c1 with c2 and c3 (squash)' '
|
||||
git reset --hard c1 &&
|
||||
git merge --squash c2 c3 &&
|
||||
@@ -432,6 +468,11 @@ test_expect_success 'combining --squash and --no-ff is refused' '
|
||||
test_must_fail git merge --no-ff --squash c1
|
||||
'
|
||||
|
||||
test_expect_success 'combining --ff-only and --no-ff is refused' '
|
||||
test_must_fail git merge --ff-only --no-ff c1 &&
|
||||
test_must_fail git merge --no-ff --ff-only c1
|
||||
'
|
||||
|
||||
test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
|
||||
git reset --hard c0 &&
|
||||
git config branch.master.mergeoptions "--no-ff" &&
|
||||
|
||||
Reference in New Issue
Block a user