summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/diff-lib.sh6
-rwxr-xr-xt/t1000-read-tree-m-3way.sh2
-rwxr-xr-xt/t1001-read-tree-m-2way.sh26
-rwxr-xr-xt/t1002-read-tree-m-u-2way.sh2
-rwxr-xr-xt/t1300-repo-config.sh8
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh4
-rwxr-xr-xt/t3002-ls-files-dashpath.sh10
-rwxr-xr-xt/t3100-ls-tree-restrict.sh2
-rwxr-xr-xt/t3101-ls-tree-dirname.sh2
-rwxr-xr-xt/t3200-branch.sh65
-rwxr-xr-xt/t3300-funny-names.sh30
-rwxr-xr-xt/t3900-i18n-commit.sh2
-rwxr-xr-xt/t4006-diff-mode.sh2
-rwxr-xr-xt/t4013-diff-various.sh7
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..master27
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..master^18
-rw-r--r--t/t4013/diff.format-patch_--attach_--stdout_initial..side9
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..master164
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..master^106
-rw-r--r--t/t4013/diff.format-patch_--inline_--stdout_initial..side59
-rwxr-xr-xt/t4015-diff-whitespace.sh12
-rwxr-xr-xt/t4016-diff-quote.sh4
-rwxr-xr-xt/t4100-apply-stat.sh14
-rwxr-xr-xt/t4104-apply-boundary.sh4
-rwxr-xr-xt/t4115-apply-symlink.sh4
-rwxr-xr-xt/t4116-apply-reverse.sh2
-rwxr-xr-xt/t4117-apply-reject.sh12
-rwxr-xr-xt/t4118-apply-empty-context.sh6
-rwxr-xr-xt/t4200-rerere.sh6
-rwxr-xr-xt/t5400-send-pack.sh2
-rwxr-xr-xt/t5401-update-hooks.sh36
-rwxr-xr-xt/t5510-fetch.sh38
-rwxr-xr-xt/t5515-fetch-merge-logic.sh2
-rw-r--r--t/t6023-merge-file.sh8
-rw-r--r--t/t6024-recursive-merge.sh4
-rwxr-xr-xt/t6200-fmt-merge-msg.sh10
-rwxr-xr-xt/t9100-git-svn-basic.sh6
-rwxr-xr-xt/t9300-fast-import.sh78
38 files changed, 623 insertions, 176 deletions
diff --git a/t/diff-lib.sh b/t/diff-lib.sh
index 745a1b0311..4624fe654c 100755
--- a/t/diff-lib.sh
+++ b/t/diff-lib.sh
@@ -11,7 +11,7 @@ compare_diff_raw () {
sed -e "$sanitize_diff_raw" <"$1" >.tmp-1
sed -e "$sanitize_diff_raw" <"$2" >.tmp-2
- diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}
sanitize_diff_raw_z='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]*$/ X X \1#/'
@@ -23,7 +23,7 @@ compare_diff_raw_z () {
tr '\0' '\012' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
tr '\0' '\012' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
- diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}
compare_diff_patch () {
@@ -37,5 +37,5 @@ compare_diff_patch () {
/^[dis]*imilarity index [0-9]*%$/d
/^index [0-9a-f]*\.\.[0-9a-f]/d
' <"$2" >.tmp-2
- diff -u .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
+ git diff .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}
diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh
index d0af8c3d52..e26a36cf0f 100755
--- a/t/t1000-read-tree-m-3way.sh
+++ b/t/t1000-read-tree-m-3way.sh
@@ -131,7 +131,7 @@ _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
check_result () {
git-ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
- diff -u expected current
+ git diff expected current
}
# This is done on an empty work directory, which is the normal
diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
index 75e4c9a886..030226bbfb 100755
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1001-read-tree-m-2way.sh
@@ -33,7 +33,7 @@ compare_change () {
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
-e 's/^\([-+][0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /p' \
"$1"
- diff -u expected current
+ git diff expected current
}
check_cache_at () {
@@ -86,7 +86,7 @@ test_expect_success \
'rm -f .git/index &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >1-3.out &&
- diff -u M.out 1-3.out &&
+ git diff M.out 1-3.out &&
check_cache_at bozbar dirty &&
check_cache_at frotz dirty &&
check_cache_at nitfol dirty'
@@ -101,7 +101,7 @@ test_expect_success \
git-update-index --add yomin &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >4.out || return 1
- diff -u M.out 4.out >4diff.out
+ git diff M.out 4.out >4diff.out
compare_change 4diff.out expected &&
check_cache_at yomin clean'
@@ -115,7 +115,7 @@ test_expect_success \
echo yomin yomin >yomin &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >5.out || return 1
- diff -u M.out 5.out >5diff.out
+ git diff M.out 5.out >5diff.out
compare_change 5diff.out expected &&
check_cache_at yomin dirty'
@@ -127,7 +127,7 @@ test_expect_success \
git-update-index --add frotz &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >6.out &&
- diff -u M.out 6.out &&
+ git diff M.out 6.out &&
check_cache_at frotz clean'
test_expect_success \
@@ -140,7 +140,7 @@ test_expect_success \
echo frotz frotz >frotz &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >7.out &&
- diff -u M.out 7.out &&
+ git diff M.out 7.out &&
check_cache_at frotz dirty'
test_expect_success \
@@ -171,7 +171,7 @@ test_expect_success \
git-update-index --add rezrov &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >10.out &&
- diff -u M.out 10.out'
+ git diff M.out 10.out'
test_expect_success \
'11 - dirty path removed.' \
@@ -216,7 +216,7 @@ test_expect_success \
git-update-index --add nitfol &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >14.out || return 1
- diff -u M.out 14.out >14diff.out
+ git diff M.out 14.out >14diff.out
compare_change 14diff.out expected &&
check_cache_at nitfol clean'
@@ -230,7 +230,7 @@ test_expect_success \
echo nitfol nitfol nitfol >nitfol &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >15.out || return 1
- diff -u M.out 15.out >15diff.out
+ git diff M.out 15.out >15diff.out
compare_change 15diff.out expected &&
check_cache_at nitfol dirty'
@@ -262,7 +262,7 @@ test_expect_success \
git-update-index --add bozbar &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >18.out &&
- diff -u M.out 18.out &&
+ git diff M.out 18.out &&
check_cache_at bozbar clean'
test_expect_success \
@@ -275,7 +275,7 @@ test_expect_success \
echo gnusto gnusto >bozbar &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >19.out &&
- diff -u M.out 19.out &&
+ git diff M.out 19.out &&
check_cache_at bozbar dirty'
test_expect_success \
@@ -287,7 +287,7 @@ test_expect_success \
git-update-index --add bozbar &&
read_tree_twoway $treeH $treeM &&
git-ls-files --stage >20.out &&
- diff -u M.out 20.out &&
+ git diff M.out 20.out &&
check_cache_at bozbar dirty'
test_expect_success \
@@ -337,7 +337,7 @@ test_expect_success \
git-update-index --add DF &&
read_tree_twoway $treeDF $treeDFDF &&
git-ls-files --stage >DFDFcheck.out &&
- diff -u DFDF.out DFDFcheck.out &&
+ git diff DFDF.out DFDFcheck.out &&
check_cache_at DF/DF dirty &&
:'
diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index da3c81357b..87fe993f59 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -16,7 +16,7 @@ compare_change () {
sed >current \
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
-e 's/^\(.[0-7][0-7][0-7][0-7][0-7][0-7]\) '"$_x40"' /\1 X /' "$1"
- diff -u expected current
+ git diff expected current
}
check_cache_at () {
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index ee386cfbf3..78c2e0864f 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -368,12 +368,12 @@ cat > expect << EOF
weird
EOF
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
test_expect_failure "rename non-existing section" \
'git-config --rename-section branch."world domination" branch.drei'
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
test_expect_success "rename another section" \
'git-config --rename-section branch."1 234 blabl/a" branch.drei'
@@ -389,7 +389,7 @@ cat > expect << EOF
weird
EOF
-test_expect_success "rename succeeded" "diff -u expect .git/config"
+test_expect_success "rename succeeded" "git diff expect .git/config"
cat >> .git/config << EOF
[branch "zwei"] a = 1 [branch "vier"]
@@ -405,7 +405,7 @@ weird
EOF
test_expect_success "section was removed properly" \
- "diff -u expect .git/config"
+ "git diff -u expect .git/config"
test_expect_success numbers '
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index 6979b7c1c0..db7a847a5d 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -65,7 +65,7 @@ test_expect_success \
--exclude-per-directory=.gitignore \
--exclude-from=.git/ignore \
>output &&
- diff -u expect output'
+ git diff expect output'
# Test \r\n (MSDOS-like systems)
printf '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore
@@ -77,6 +77,6 @@ test_expect_success \
--exclude-per-directory=.gitignore \
--exclude-from=.git/ignore \
>output &&
- diff -u expect output'
+ git diff expect output'
test_done
diff --git a/t/t3002-ls-files-dashpath.sh b/t/t3002-ls-files-dashpath.sh
index b42f1382bc..cc8967d76b 100755
--- a/t/t3002-ls-files-dashpath.sh
+++ b/t/t3002-ls-files-dashpath.sh
@@ -23,7 +23,7 @@ test_expect_success \
test_expect_success \
'git-ls-files without path restriction.' \
'git-ls-files --others >output &&
- diff -u output - <<EOF
+ git diff output - <<EOF
--
-foo
output
@@ -34,7 +34,7 @@ EOF
test_expect_success \
'git-ls-files with path restriction.' \
'git-ls-files --others path0 >output &&
- diff -u output - <<EOF
+ git diff output - <<EOF
path0
EOF
'
@@ -42,7 +42,7 @@ EOF
test_expect_success \
'git-ls-files with path restriction with --.' \
'git-ls-files --others -- path0 >output &&
- diff -u output - <<EOF
+ git diff output - <<EOF
path0
EOF
'
@@ -50,7 +50,7 @@ EOF
test_expect_success \
'git-ls-files with path restriction with -- --.' \
'git-ls-files --others -- -- >output &&
- diff -u output - <<EOF
+ git diff output - <<EOF
--
EOF
'
@@ -58,7 +58,7 @@ EOF
test_expect_success \
'git-ls-files with no path restriction.' \
'git-ls-files --others -- >output &&
- diff -u output - <<EOF
+ git diff output - <<EOF
--
-foo
output
diff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh
index 2ec06d3d39..e10749245b 100755
--- a/t/t3100-ls-tree-restrict.sh
+++ b/t/t3100-ls-tree-restrict.sh
@@ -35,7 +35,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
test_output () {
sed -e "s/ $_x40 / X /" <current >check
- diff -u expected check
+ git diff expected check
}
test_expect_success \
diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh
index d78deb1e71..087929a4bf 100755
--- a/t/t3101-ls-tree-dirname.sh
+++ b/t/t3101-ls-tree-dirname.sh
@@ -43,7 +43,7 @@ _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
test_output () {
sed -e "s/ $_x40 / X /" <current >check
- diff -u expected check
+ git diff expected check
}
test_expect_success \
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 5565c27033..75c000a968 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -47,17 +47,6 @@ test_expect_success \
test ! -f .git/refs/heads/d/e/f &&
test ! -f .git/logs/refs/heads/d/e/f'
-cat >expect <<EOF
-0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 checkout: Created from master
-EOF
-test_expect_success \
- 'git checkout -b g/h/i -l should create a branch and a log' \
- 'GIT_COMMITTER_DATE="2005-05-26 23:30" \
- git-checkout -b g/h/i -l master &&
- test -f .git/refs/heads/g/h/i &&
- test -f .git/logs/refs/heads/g/h/i &&
- diff expect .git/logs/refs/heads/g/h/i'
-
test_expect_success \
'git branch j/k should work after branch j has been deleted' \
'git-branch j &&
@@ -117,4 +106,58 @@ test_expect_failure \
ln -s real-u .git/logs/refs/heads/u &&
git-branch -m u v'
+test_expect_success 'test tracking setup via --track' \
+ 'git-config remote.local.url . &&
+ git-config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
+ (git-show-ref -q refs/remotes/local/master || git-fetch local) &&
+ git-branch --track my1 local/master &&
+ test $(git-config branch.my1.remote) = local &&
+ test $(git-config branch.my1.merge) = refs/heads/master'
+
+test_expect_success 'test tracking setup (non-wildcard, matching)' \
+ 'git-config remote.local.url . &&
+ git-config remote.local.fetch refs/heads/master:refs/remotes/local/master &&
+ (git-show-ref -q refs/remotes/local/master || git-fetch local) &&
+ git-branch --track my4 local/master &&
+ test $(git-config branch.my4.remote) = local &&
+ test $(git-config branch.my4.merge) = refs/heads/master'
+
+test_expect_success 'test tracking setup (non-wildcard, not matching)' \
+ 'git-config remote.local.url . &&
+ git-config remote.local.fetch refs/heads/s:refs/remotes/local/s &&
+ (git-show-ref -q refs/remotes/local/master || git-fetch local) &&
+ git-branch --track my5 local/master &&
+ ! test $(git-config branch.my5.remote) = local &&
+ ! test $(git-config branch.my5.merge) = refs/heads/master'
+
+test_expect_success 'test tracking setup via config' \
+ 'git-config branch.autosetupmerge true &&
+ git-config remote.local.url . &&
+ git-config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
+ (git-show-ref -q refs/remotes/local/master || git-fetch local) &&
+ git-branch my3 local/master &&
+ test $(git-config branch.my3.remote) = local &&
+ test $(git-config branch.my3.merge) = refs/heads/master'
+
+test_expect_success 'test overriding tracking setup via --no-track' \
+ 'git-config branch.autosetupmerge true &&
+ git-config remote.local.url . &&
+ git-config remote.local.fetch refs/heads/*:refs/remotes/local/* &&
+ (git-show-ref -q refs/remotes/local/master || git-fetch local) &&
+ git-branch --no-track my2 local/master &&
+ ! test $(git-config branch.my2.remote) = local &&
+ ! test $(git-config branch.my2.merge) = refs/heads/master'
+
+# Keep this test last, as it changes the current branch
+cat >expect <<EOF
+0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
+EOF
+test_expect_success \
+ 'git checkout -b g/h/i -l should create a branch and a log' \
+ 'GIT_COMMITTER_DATE="2005-05-26 23:30" \
+ git-checkout -b g/h/i -l master &&
+ test -f .git/refs/heads/g/h/i &&
+ test -f .git/logs/refs/heads/g/h/i &&
+ diff expect .git/logs/refs/heads/g/h/i'
+
test_done
diff --git a/t/t3300-funny-names.sh b/t/t3300-funny-names.sh
index c12270efab..b5a1400e18 100755
--- a/t/t3300-funny-names.sh
+++ b/t/t3300-funny-names.sh
@@ -35,7 +35,7 @@ no-funny' >expected
test_expect_success 'git-ls-files no-funny' \
'git-update-index --add "$p0" "$p2" &&
git-ls-files >current &&
- diff -u expected current'
+ git diff expected current'
t0=`git-write-tree`
echo "$t0" >t0
@@ -48,14 +48,14 @@ EOF
test_expect_success 'git-ls-files with-funny' \
'git-update-index --add "$p1" &&
git-ls-files >current &&
- diff -u expected current'
+ git diff expected current'
echo 'just space
no-funny
tabs ," (dq) and spaces' >expected
test_expect_success 'git-ls-files -z with-funny' \
'git-ls-files -z | tr \\0 \\012 >current &&
- diff -u expected current'
+ git diff expected current'
t1=`git-write-tree`
echo "$t1" >t1
@@ -67,28 +67,28 @@ no-funny
EOF
test_expect_success 'git-ls-tree with funny' \
'git-ls-tree -r $t1 | sed -e "s/^[^ ]* //" >current &&
- diff -u expected current'
+ git diff expected current'
cat > expected <<\EOF
A "tabs\t,\" (dq) and spaces"
EOF
test_expect_success 'git-diff-index with-funny' \
'git-diff-index --name-status $t0 >current &&
- diff -u expected current'
+ git diff expected current'
test_expect_success 'git-diff-tree with-funny' \
'git-diff-tree --name-status $t0 $t1 >current &&
- diff -u expected current'
+ git diff expected current'
echo 'A
tabs ," (dq) and spaces' >expected
test_expect_success 'git-diff-index -z with-funny' \
'git-diff-index -z --name-status $t0 | tr \\0 \\012 >current &&
- diff -u expected current'
+ git diff expected current'
test_expect_success 'git-diff-tree -z with-funny' \
'git-diff-tree -z --name-status $t0 $t1 | tr \\0 \\012 >current &&
- diff -u expected current'
+ git diff expected current'
cat > expected <<\EOF
CNUM no-funny "tabs\t,\" (dq) and spaces"
@@ -96,7 +96,7 @@ EOF
test_expect_success 'git-diff-tree -C with-funny' \
'git-diff-tree -C --find-copies-harder --name-status \
$t0 $t1 | sed -e 's/^C[0-9]*/CNUM/' >current &&
- diff -u expected current'
+ git diff expected current'
cat > expected <<\EOF
RNUM no-funny "tabs\t,\" (dq) and spaces"
@@ -105,7 +105,7 @@ test_expect_success 'git-diff-tree delete with-funny' \
'git-update-index --force-remove "$p0" &&
git-diff-index -M --name-status \
$t0 | sed -e 's/^R[0-9]*/RNUM/' >current &&
- diff -u expected current'
+ git diff expected current'
cat > expected <<\EOF
diff --git a/no-funny "b/tabs\t,\" (dq) and spaces"
@@ -116,7 +116,7 @@ EOF
test_expect_success 'git-diff-tree delete with-funny' \
'git-diff-index -M -p $t0 |
sed -e "s/index [0-9]*%/index NUM%/" >current &&
- diff -u expected current'
+ git diff expected current'
chmod +x "$p1"
cat > expected <<\EOF
@@ -130,7 +130,7 @@ EOF
test_expect_success 'git-diff-tree delete with-funny' \
'git-diff-index -M -p $t0 |
sed -e "s/index [0-9]*%/index NUM%/" >current &&
- diff -u expected current'
+ git diff expected current'
cat >expected <<\EOF
"tabs\t,\" (dq) and spaces"
@@ -139,7 +139,7 @@ EOF
test_expect_success 'git-diff-tree rename with-funny applied' \
'git-diff-index -M -p $t0 |
git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
- diff -u expected current'
+ git diff expected current'
cat > expected <<\EOF
no-funny
@@ -149,12 +149,12 @@ EOF
test_expect_success 'git-diff-tree delete with-funny applied' \
'git-diff-index -p $t0 |
git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
- diff -u expected current'
+ git diff expected current'
test_expect_success 'git-apply non-git diff' \
'git-diff-index -p $t0 |
sed -ne "/^[-+@]/p" |
git-apply --stat | sed -e "s/|.*//" -e "s/ *\$//" >current &&
- diff -u expected current'
+ git diff expected current'
test_done
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index e54fe0f401..ffddb68db3 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -9,7 +9,7 @@ test_description='commit and log output encodings'
compare_with () {
git-show -s $1 | sed -e '1,/^$/d' -e 's/^ //' -e '$d' >current &&
- diff -u current "$2"
+ git diff current "$2"
}
test_expect_success setup '
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index ca342f48a1..e72c6fd1b4 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -38,7 +38,7 @@ echo ":100644 100755 X X M rezrov" >expected
test_expect_success \
'verify' \
- 'diff -u expected check'
+ 'git diff expected check'
test_done
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 3d85ceaae9..488e075c16 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -106,12 +106,12 @@ do
echo "\$ git $cmd"
git $cmd |
sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
- -e "s/^\\( *boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
+ -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
echo "\$"
} >"$actual" &&
if test -f "$expect"
then
- diff -u "$expect" "$actual" &&
+ git diff "$expect" "$actual" &&
rm -f "$actual"
else
# this is to help developing new tests.
@@ -238,6 +238,9 @@ format-patch --stdout initial..master
format-patch --attach --stdout initial..side
format-patch --attach --stdout initial..master^
format-patch --attach --stdout initial..master
+format-patch --inline --stdout initial..side
+format-patch --inline --stdout initial..master^
+format-patch --inline --stdout initial..master
diff --abbrev initial..side
diff -r initial..side
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
index e5ddd6fcbb..cf6891f748 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master
@@ -4,8 +4,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -21,11 +20,9 @@ This is the second commit.
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Disposition: attachment; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
@@ -66,8 +63,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -80,11 +76,9 @@ Content-Transfer-Encoding: 8bit
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Disposition: attachment; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
@@ -115,8 +109,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:03:00 +0000
Subject: [PATCH] Side
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -130,11 +123,9 @@ Content-Transfer-Encoding: 8bit
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Disposition: attachment; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
diff --git a/dir/sub b/dir/sub
index 35d242b..7289e35 100644
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
index d0dd19b623..fe0258720c 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^
@@ -4,8 +4,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -21,11 +20,9 @@ This is the second commit.
3 files changed, 5 insertions(+), 3 deletions(-)
delete mode 100644 file2
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Disposition: attachment; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
@@ -66,8 +63,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -80,11 +76,9 @@ Content-Transfer-Encoding: 8bit
2 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 file1
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Disposition: attachment; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
index 67a95c5cba..9ff828ee9d 100644
--- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side
+++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side
@@ -4,8 +4,7 @@ From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:03:00 +0000
Subject: [PATCH] Side
MIME-Version: 1.0
-Content-Type: multipart/mixed;
- boundary="------------g-i-t--v-e-r-s-i-o-n"
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
@@ -19,11 +18,9 @@ Content-Transfer-Encoding: 8bit
3 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 file3
--------------g-i-t--v-e-r-s-i-o-n
-Content-Type: text/x-patch;
- name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
Content-Transfer-Encoding: 8bit
-Content-Disposition: inline;
- filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Disposition: attachment; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
diff --git a/dir/sub b/dir/sub
index 35d242b..7289e35 100644
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_initial..master
new file mode 100644
index 0000000000..aa110c0e7f
--- /dev/null
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master
@@ -0,0 +1,164 @@
+$ git format-patch --inline --stdout initial..master
+From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:01:00 +0000
+Subject: [PATCH] Second
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+This is the second commit.
+---
+ dir/sub | 2 ++
+ file0 | 3 +++
+ file2 | 3 ---
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..8422d40 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++C
++D
+diff --git a/file0 b/file0
+index 01e79c3..b414108 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++4
++5
++6
+diff --git a/file2 b/file2
+deleted file mode 100644
+index 01e79c3..0000000
+--- a/file2
++++ /dev/null
+@@ -1,3 +0,0 @@
+-1
+-2
+-3
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+
+From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:02:00 +0000
+Subject: [PATCH] Third
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ dir/sub | 2 ++
+ file1 | 3 +++
+ 2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 8422d40..cead32e 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -2,3 +2,5 @@ A
+ B
+ C
+ D
++E
++F
+diff --git a/file1 b/file1
+new file mode 100644
+index 0000000..b1e6722
+--- /dev/null
++++ b/file1
+@@ -0,0 +1,3 @@
++A
++B
++C
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+
+From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:03:00 +0000
+Subject: [PATCH] Side
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ dir/sub | 2 ++
+ file0 | 3 +++
+ file3 | 4 ++++
+ 3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..7289e35 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++1
++2
+diff --git a/file0 b/file0
+index 01e79c3..f4615da 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++A
++B
++C
+diff --git a/file3 b/file3
+new file mode 100644
+index 0000000..7289e35
+--- /dev/null
++++ b/file3
+@@ -0,0 +1,4 @@
++A
++B
++1
++2
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+$
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^
new file mode 100644
index 0000000000..95e9ea4c59
--- /dev/null
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^
@@ -0,0 +1,106 @@
+$ git format-patch --inline --stdout initial..master^
+From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:01:00 +0000
+Subject: [PATCH] Second
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+This is the second commit.
+---
+ dir/sub | 2 ++
+ file0 | 3 +++
+ file2 | 3 ---
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+ delete mode 100644 file2
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..8422d40 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++C
++D
+diff --git a/file0 b/file0
+index 01e79c3..b414108 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++4
++5
++6
+diff --git a/file2 b/file2
+deleted file mode 100644
+index 01e79c3..0000000
+--- a/file2
++++ /dev/null
+@@ -1,3 +0,0 @@
+-1
+-2
+-3
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+
+From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:02:00 +0000
+Subject: [PATCH] Third
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ dir/sub | 2 ++
+ file1 | 3 +++
+ 2 files changed, 5 insertions(+), 0 deletions(-)
+ create mode 100644 file1
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 8422d40..cead32e 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -2,3 +2,5 @@ A
+ B
+ C
+ D
++E
++F
+diff --git a/file1 b/file1
+new file mode 100644
+index 0000000..b1e6722
+--- /dev/null
++++ b/file1
+@@ -0,0 +1,3 @@
++A
++B
++C
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+$
diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..side b/t/t4013/diff.format-patch_--inline_--stdout_initial..side
new file mode 100644
index 0000000000..86ae923d71
--- /dev/null
+++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..side
@@ -0,0 +1,59 @@
+$ git format-patch --inline --stdout initial..side
+From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001
+From: A U Thor <author@example.com>
+Date: Mon, 26 Jun 2006 00:03:00 +0000
+Subject: [PATCH] Side
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n"
+
+This is a multi-part message in MIME format.
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ dir/sub | 2 ++
+ file0 | 3 +++
+ file3 | 4 ++++
+ 3 files changed, 9 insertions(+), 0 deletions(-)
+ create mode 100644 file3
+--------------g-i-t--v-e-r-s-i-o-n
+Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: inline; filename="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff"
+
+diff --git a/dir/sub b/dir/sub
+index 35d242b..7289e35 100644
+--- a/dir/sub
++++ b/dir/sub
+@@ -1,2 +1,4 @@
+ A
+ B
++1
++2
+diff --git a/file0 b/file0
+index 01e79c3..f4615da 100644
+--- a/file0
++++ b/file0
+@@ -1,3 +1,6 @@
+ 1
+ 2
+ 3
++A
++B
++C
+diff --git a/file3 b/file3
+new file mode 100644
+index 0000000..7289e35
+--- /dev/null
++++ b/file3
+@@ -0,0 +1,4 @@
++A
++B
++1
++2
+
+--------------g-i-t--v-e-r-s-i-o-n--
+
+
+$
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index adf4993bac..930e209d31 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -43,13 +43,13 @@ index adf3937..6edc172 100644
EOF
git-diff > out
-test_expect_success "Ray's example without options" 'diff -u expect out'
+test_expect_success "Ray's example without options" 'git diff expect out'
git-diff -w > out
-test_expect_success "Ray's example with -w" 'diff -u expect out'
+test_expect_success "Ray's example with -w" 'git diff expect out'
git-diff -b > out
-test_expect_success "Ray's example with -b" 'diff -u expect out'
+test_expect_success "Ray's example with -b" 'git diff expect out'
tr 'Q' '\015' << EOF > x
whitespace at beginning
@@ -90,14 +90,14 @@ index d99af23..8b32fb5 100644
+CR at end
EOF
git-diff > out
-test_expect_success 'another test, without options' 'diff -u expect out'
+test_expect_success 'another test, without options' 'git diff expect out'
cat << EOF > expect
diff --git a/x b/x
index d99af23..8b32fb5 100644
EOF
git-diff -w > out
-test_expect_success 'another test, with -w' 'diff -u expect out'
+test_expect_success 'another test, with -w' 'git diff expect out'
tr 'Q' '\015' << EOF > expect
diff --git a/x b/x
@@ -115,6 +115,6 @@ index d99af23..8b32fb5 100644
CR at endQ
EOF
git-diff -b > out
-test_expect_success 'another test, with -b' 'diff -u expect out'
+test_expect_success 'another test, with -b' 'git diff expect out'
test_done
diff --git a/t/t4016-diff-quote.sh b/t/t4016-diff-quote.sh
index 2e7cd5f255..5dbdc0c9fa 100755
--- a/t/t4016-diff-quote.sh
+++ b/t/t4016-diff-quote.sh
@@ -49,7 +49,7 @@ cat >expect <<\EOF
EOF
test_expect_success 'git diff --summary -M HEAD' '
git diff --summary -M HEAD >actual &&
- diff -u expect actual
+ git diff expect actual
'
cat >expect <<\EOF
@@ -64,7 +64,7 @@ cat >expect <<\EOF
EOF
test_expect_success 'git diff --stat -M HEAD' '
git diff --stat -M HEAD >actual &&
- diff -u expect actual
+ git diff expect actual
'
test_done
diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh
index 6579f06b05..7b81c32e57 100755
--- a/t/t4100-apply-stat.sh
+++ b/t/t4100-apply-stat.sh
@@ -11,37 +11,37 @@ test_description='git-apply --stat --summary test.
test_expect_success \
'rename' \
'git-apply --stat --summary <../t4100/t-apply-1.patch >current &&
- diff -u ../t4100/t-apply-1.expect current'
+ git diff ../t4100/t-apply-1.expect current'
test_expect_success \
'copy' \
'git-apply --stat --summary <../t4100/t-apply-2.patch >current &&
- diff -u ../t4100/t-apply-2.expect current'
+ git diff ../t4100/t-apply-2.expect current'
test_expect_success \
'rewrite' \
'git-apply --stat --summary <../t4100/t-apply-3.patch >current &&
- diff -u ../t4100/t-apply-3.expect current'
+ git diff ../t4100/t-apply-3.expect current'
test_expect_success \
'mode' \
'git-apply --stat --summary <../t4100/t-apply-4.patch >current &&
- diff -u ../t4100/t-apply-4.expect current'
+ git diff ../t4100/t-apply-4.expect current'
test_expect_success \
'non git' \
'git-apply --stat --summary <../t4100/t-apply-5.patch >current &&
- diff -u ../t4100/t-apply-5.expect current'
+ git diff ../t4100/t-apply-5.expect current'
test_expect_success \
'non git' \
'git-apply --stat --summary <../t4100/t-apply-6.patch >current &&
- diff -u ../t4100/t-apply-6.expect current'
+ git diff ../t4100/t-apply-6.expect current'
test_expect_success \
'non git' \
'git-apply --stat --summary <../t4100/t-apply-7.patch >current &&
- diff -u ../t4100/t-apply-7.expect current'
+ git diff ../t4100/t-apply-7.expect current'
test_done
diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh
index 2ff800c23f..a5fb3ea40e 100755
--- a/t/t4104-apply-boundary.sh
+++ b/t/t4104-apply-boundary.sh
@@ -90,7 +90,7 @@ do
cat '"$kind-patch.$with"'
(exit 1)
} &&
- diff -u '"$kind"'-expect victim
+ git diff '"$kind"'-expect victim
'
done
done
@@ -108,7 +108,7 @@ do
cat '"$kind-ng.without"'
(exit 1)
} &&
- diff -u '"$kind"'-expect victim
+ git diff '"$kind"'-expect victim
'
done
diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh
index d5f2cfb186..b947ed83bb 100755
--- a/t/t4115-apply-symlink.sh
+++ b/t/t4115-apply-symlink.sh
@@ -33,7 +33,7 @@ test_expect_success 'apply symlink patch' '
git checkout side &&
git apply patch &&
git diff-files -p >patched &&
- diff -u patch patched
+ git diff patch patched
'
@@ -42,7 +42,7 @@ test_expect_success 'apply --index symlink patch' '
git checkout -f side &&
git apply --index patch &&
git diff-index --cached -p HEAD >patched &&
- diff -u patch patched
+ git diff patch patched
'
diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh
index aa2c869e0e..2685b22630 100755
--- a/t/t4116-apply-reverse.sh
+++ b/t/t4116-apply-reverse.sh
@@ -42,7 +42,7 @@ test_expect_success 'apply in reverse' '
git reset --hard second &&
git apply --reverse --binary --index patch &&
git diff >diff &&
- diff -u /dev/null diff
+ git diff /dev/null diff
'
diff --git a/t/t4117-apply-reject.sh b/t/t4117-apply-reject.sh
index b4de075a3e..91931f0e3f 100755
--- a/t/t4117-apply-reject.sh
+++ b/t/t4117-apply-reject.sh
@@ -54,7 +54,7 @@ test_expect_success 'apply without --reject should fail' '
exit 1
fi
- diff -u file1 saved.file1
+ git diff file1 saved.file1
'
test_expect_success 'apply without --reject should fail' '
@@ -65,7 +65,7 @@ test_expect_success 'apply without --reject should fail' '
exit 1
fi
- diff -u file1 saved.file1
+ git diff file1 saved.file1
'
test_expect_success 'apply with --reject should fail but update the file' '
@@ -79,7 +79,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
exit 1
fi
- diff -u file1 expected &&
+ git diff file1 expected &&
cat file1.rej &&
@@ -105,7 +105,7 @@ test_expect_success 'apply with --reject should fail but update the file' '
echo "file1 still exists?"
exit 1
}
- diff -u file2 expected &&
+ git diff file2 expected &&
cat file2.rej &&
@@ -132,7 +132,7 @@ test_expect_success 'the same test with --verbose' '
echo "file1 still exists?"
exit 1
}
- diff -u file2 expected &&
+ git diff file2 expected &&
cat file2.rej &&
@@ -151,7 +151,7 @@ test_expect_success 'apply cleanly with --verbose' '
git apply --verbose patch.1 &&
- diff -u file1 clean
+ git diff file1 clean
'
test_done
diff --git a/t/t4118-apply-empty-context.sh b/t/t4118-apply-empty-context.sh
index 7309422fe5..690a182003 100755
--- a/t/t4118-apply-empty-context.sh
+++ b/t/t4118-apply-empty-context.sh
@@ -37,7 +37,7 @@ test_expect_success 'apply --numstat' '
echo "0 1 file1" &&
echo "0 1 file2"
} >expect &&
- diff -u expect actual
+ git diff expect actual
'
@@ -47,8 +47,8 @@ test_expect_success 'apply --apply' '
cat file2.orig >file2 &&
git update-index file1 file2 &&
git apply --index diff.output &&
- diff -u file1.mods file1 &&
- diff -u file2.mods file2
+ git diff file1.mods file1 &&
+ git diff file2.mods file2
'
test_done
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 639d45fcec..e081b32aff 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -70,7 +70,7 @@ EOF
git rerere diff > out
-test_expect_success 'rerere diff' 'diff -u expect out'
+test_expect_success 'rerere diff' 'git diff expect out'
cat > expect << EOF
a1
@@ -78,7 +78,7 @@ EOF
git rerere status > out
-test_expect_success 'rerere status' 'diff -u expect out'
+test_expect_success 'rerere status' 'git diff expect out'
test_expect_success 'commit succeeds' \
"git commit -q -a -m 'prefer first over second'"
@@ -94,7 +94,7 @@ test_expect_failure 'another conflicting merge' 'git pull . first'
git show first:a1 | sed 's/To die: t/To die! T/' > expect
test_expect_success 'rerere kicked in' "! grep ======= a1"
-test_expect_success 'rerere prefers first change' 'diff -u a1 expect'
+test_expect_success 'rerere prefers first change' 'git diff a1 expect'
rm $rr/postimage
echo "$sha1 a1" | tr '\012' '\0' > .git/rr-cache/MERGE_RR
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index b1c97b0dfb..477b267599 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -110,7 +110,7 @@ test_expect_success \
cd .. &&
git-update-ref refs/heads/master master^ || return 1
git-send-pack --force ./victim/.git/ master && return 1
- ! diff .git/refs/heads/master victim/.git/refs/heads/master
+ ! git diff .git/refs/heads/master victim/.git/refs/heads/master
'
test_done
diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
index 0c0034e34c..f1c7ff0c0a 100755
--- a/t/t5401-update-hooks.sh
+++ b/t/t5401-update-hooks.sh
@@ -25,8 +25,8 @@ test_expect_success setup '
cat >victim/.git/hooks/pre-receive <<'EOF'
#!/bin/sh
-echo "$@" >>$GIT_DIR/pre-receive.args
-read x; printf "$x" >$GIT_DIR/pre-receive.stdin
+printf "$@" >>$GIT_DIR/pre-receive.args
+cat - >$GIT_DIR/pre-receive.stdin
echo STDOUT pre-receive
echo STDERR pre-receive >&2
EOF
@@ -44,8 +44,8 @@ chmod u+x victim/.git/hooks/update
cat >victim/.git/hooks/post-receive <<'EOF'
#!/bin/sh
-echo "$@" >>$GIT_DIR/post-receive.args
-read x; printf "$x" >$GIT_DIR/post-receive.stdin
+printf "$@" >>$GIT_DIR/post-receive.args
+cat - >$GIT_DIR/post-receive.stdin
echo STDOUT post-receive
echo STDERR post-receive >&2
EOF
@@ -80,36 +80,38 @@ test_expect_success 'hooks ran' '
test -f victim/.git/post-update.stdin
'
-test_expect_success 'pre-receive hook arguments' '
- echo \
- refs/heads/master $commit0 $commit1 \
- refs/heads/tofail $commit1 $commit0 \
- | diff - victim/.git/pre-receive.args
+test_expect_success 'pre-receive hook input' '
+ (echo $commit0 $commit1 refs/heads/master;
+ echo $commit1 $commit0 refs/heads/tofail
+ ) | git diff - victim/.git/pre-receive.stdin
'
test_expect_success 'update hook arguments' '
(echo refs/heads/master $commit0 $commit1;
echo refs/heads/tofail $commit1 $commit0
- ) | diff - victim/.git/update.args
+ ) | git diff - victim/.git/update.args
'
-test_expect_success 'post-receive hook arguments' '
- echo refs/heads/master $commit0 $commit1 |
- diff - victim/.git/post-receive.args
+test_expect_success 'post-receive hook input' '
+ echo $commit0 $commit1 refs/heads/master |
+ git diff - victim/.git/post-receive.stdin
'
test_expect_success 'post-update hook arguments' '
echo refs/heads/master |
- diff -u - victim/.git/post-update.args
+ git diff - victim/.git/post-update.args
'
test_expect_success 'all hook stdin is /dev/null' '
- ! test -s victim/.git/pre-receive.stdin &&
! test -s victim/.git/update.stdin &&
- ! test -s victim/.git/post-receive.stdin &&
! test -s victim/.git/post-update.stdin
'
+test_expect_success 'all *-receive hook args are empty' '
+ ! test -s victim/.git/pre-receive.args &&
+ ! test -s victim/.git/post-receive.args
+'
+
test_expect_failure 'send-pack produced no output' '
test -s send.out
'
@@ -128,7 +130,7 @@ STDERR post-update
EOF
test_expect_success 'send-pack stderr contains hook messages' '
egrep ^STD send.err >actual &&
- diff - actual <expect
+ git diff - actual <expect
'
test_done
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index fa76662dce..426017e1d0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -90,6 +90,13 @@ test_expect_success 'create bundle 1' '
git bundle create bundle1 master^..master
'
+test_expect_success 'header of bundle looks right' '
+ head -n 1 "$D"/bundle1 | grep "^#" &&
+ head -n 2 "$D"/bundle1 | grep "^-[0-9a-f]\{40\} " &&
+ head -n 3 "$D"/bundle1 | grep "^[0-9a-f]\{40\} " &&
+ head -n 4 "$D"/bundle1 | grep "^$"
+'
+
test_expect_success 'create bundle 2' '
cd "$D" &&
git bundle create bundle2 master~2..master
@@ -101,10 +108,41 @@ test_expect_failure 'unbundle 1' '
git fetch "$D/bundle1" master:master
'
+test_expect_success 'bundle 1 has only 3 files ' '
+ cd "$D" &&
+ (
+ while read x && test -n "$x"
+ do
+ :;
+ done
+ cat
+ ) <bundle1 >bundle.pack &&
+ git index-pack bundle.pack &&
+ verify=$(git verify-pack -v bundle.pack) &&
+ test 4 = $(echo "$verify" | wc -l)
+'
+
test_expect_success 'unbundle 2' '
cd "$D/bundle" &&
git fetch ../bundle2 master:master &&
test "tip" = "$(git log -1 --pretty=oneline master | cut -b42-)"
'
+test_expect_success 'bundle does not prerequisite objects' '
+ cd "$D" &&
+ touch file2 &&
+ git add file2 &&
+ git commit -m add.file2 file2 &&
+ git bundle create bundle3 -1 HEAD &&
+ (
+ while read x && test -n "$x"
+ do
+ :;
+ done
+ cat
+ ) <bundle3 >bundle.pack &&
+ git index-pack bundle.pack &&
+ test 4 = $(git verify-pack -v bundle.pack | wc -l)
+'
+
test_done
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 0b600bb429..6c9cc67508 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -149,7 +149,7 @@ do
} >"$actual" &&
if test -f "$expect"
then
- diff -u "$expect" "$actual" &&
+ git diff -u "$expect" "$actual" &&
rm -f "$actual"
else
# this is to help developing new tests.
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index f3cd3dba4d..c76fccfb5a 100644
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -63,7 +63,7 @@ test_expect_success "merge without conflict (missing LF at EOF)" \
"git-merge-file test2.txt orig.txt new2.txt"
test_expect_success "merge result added missing LF" \
- "diff -u test.txt test2.txt"
+ "git diff test.txt test2.txt"
cp test.txt backup.txt
test_expect_failure "merge with conflicts" \
@@ -86,7 +86,7 @@ non timebo mala, quoniam tu mecum es:
virga tua et baculus tuus ipsa me consolata sunt.
EOF
-test_expect_success "expected conflict markers" "diff -u test.txt expect.txt"
+test_expect_success "expected conflict markers" "git diff test.txt expect.txt"
cp backup.txt test.txt
test_expect_failure "merge with conflicts, using -L" \
@@ -110,7 +110,7 @@ virga tua et baculus tuus ipsa me consolata sunt.
EOF
test_expect_success "expected conflict markers, with -L" \
- "diff -u test.txt expect.txt"
+ "git diff test.txt expect.txt"
sed "s/ tu / TU /" < new1.txt > new5.txt
test_expect_failure "conflict in removed tail" \
@@ -132,7 +132,7 @@ virga tua et baculus tuus ipsa me consolata sunt.
>>>>>>> new5.txt
EOF
-test_expect_success "expected conflict markers" "diff -u expect out"
+test_expect_success "expected conflict markers" "git diff expect out"
test_done
diff --git a/t/t6024-recursive-merge.sh b/t/t6024-recursive-merge.sh
index 31b96257b4..a398556137 100644
--- a/t/t6024-recursive-merge.sh
+++ b/t/t6024-recursive-merge.sh
@@ -70,7 +70,7 @@ G
>>>>>>> G:a1
EOF
-test_expect_success "result contains a conflict" "diff -u expect a1"
+test_expect_success "result contains a conflict" "git diff expect a1"
git ls-files --stage > out
cat > expect << EOF
@@ -79,6 +79,6 @@ cat > expect << EOF
100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1
EOF
-test_expect_success "virtual trees were processed" "diff -u expect out"
+test_expect_success "virtual trees were processed" "git diff expect out"
test_done
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index ea14023616..526d7d1c44 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -79,7 +79,7 @@ test_expect_success 'merge-msg test #1' '
git fetch . left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- diff -u actual expected
+ git diff actual expected
'
cat >expected <<\EOF
@@ -92,7 +92,7 @@ test_expect_success 'merge-msg test #2' '
git fetch ../trash left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- diff -u actual expected
+ git diff actual expected
'
cat >expected <<\EOF
@@ -115,7 +115,7 @@ test_expect_success 'merge-msg test #3' '
git fetch . left &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- diff -u actual expected
+ git diff actual expected
'
cat >expected <<\EOF
@@ -145,7 +145,7 @@ test_expect_success 'merge-msg test #4' '
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- diff -u actual expected
+ git diff actual expected
'
test_expect_success 'merge-msg test #5' '
@@ -157,7 +157,7 @@ test_expect_success 'merge-msg test #5' '
git fetch . left right &&
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
- diff -u actual expected
+ git diff actual expected
'
test_done
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index 7dcfc7e7db..eb628fe075 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -169,7 +169,7 @@ test_expect_success "$name" "
svn up '$SVN_TREE' &&
test -f '$SVN_TREE'/exec-2.sh &&
test ! -L '$SVN_TREE'/exec-2.sh &&
- diff -u help $SVN_TREE/exec-2.sh"
+ git diff help $SVN_TREE/exec-2.sh"
if test "$have_utf8" = t
then
@@ -193,7 +193,7 @@ test_expect_success "$name" \
"git-svn init $svnrepo && git-svn fetch &&
git-rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
git-rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
- diff -u a b"
+ git diff a b"
name='check imported tree checksums expected tree checksums'
rm -f expected
@@ -211,7 +211,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
EOF
-test_expect_success "$name" "diff -u a expected"
+test_expect_success "$name" "git diff a expected"
test_expect_failure 'exit if remote refs are ambigious' "
git-config --add svn-remote.svn.fetch \
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 2e1a09ff2d..8e958da536 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -74,7 +74,7 @@ EOF
test_expect_success \
'A: verify commit' \
'git-cat-file commit master | sed 1d >actual &&
- diff -u expect actual'
+ git diff expect actual'
cat >expect <<EOF
100644 blob file2
@@ -84,22 +84,22 @@ EOF
test_expect_success \
'A: verify tree' \
'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
- diff -u expect actual'
+ git diff expect actual'
echo "$file2_data" >expect
test_expect_success \
'A: verify file2' \
- 'git-cat-file blob master:file2 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file2 >actual && git diff expect actual'
echo "$file3_data" >expect
test_expect_success \
'A: verify file3' \
- 'git-cat-file blob master:file3 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file3 >actual && git diff expect actual'
printf "$file4_data" >expect
test_expect_success \
'A: verify file4' \
- 'git-cat-file blob master:file4 >actual && diff -u expect actual'
+ 'git-cat-file blob master:file4 >actual && git diff expect actual'
cat >expect <<EOF
:2 `git-rev-parse --verify master:file2`
@@ -109,7 +109,7 @@ cat >expect <<EOF
EOF
test_expect_success \
'A: verify marks output' \
- 'diff -u expect marks.out'
+ 'git diff expect marks.out'
test_expect_success \
'A: verify marks import' \
@@ -117,7 +117,7 @@ test_expect_success \
--import-marks=marks.out \
--export-marks=marks.new \
</dev/null &&
- diff -u expect marks.new'
+ git diff -u expect marks.new'
###
### series B
@@ -183,7 +183,7 @@ EOF
test_expect_success \
'C: verify commit' \
'git-cat-file commit branch | sed 1d >actual &&
- diff -u expect actual'
+ git diff expect actual'
cat >expect <<EOF
:000000 100755 0000000000000000000000000000000000000000 f1fb5da718392694d0076d677d6d0e364c79b0bc A file2/newf
@@ -240,13 +240,13 @@ echo "$file5_data" >expect
test_expect_success \
'D: verify file5' \
'git-cat-file blob branch:newdir/interesting >actual &&
- diff -u expect actual'
+ git diff expect actual'
echo "$file6_data" >expect
test_expect_success \
'D: verify file6' \
'git-cat-file blob branch:newdir/exec.sh >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series E
@@ -282,7 +282,7 @@ EOF
test_expect_success \
'E: verify commit' \
'git-cat-file commit branch | sed 1,2d >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series F
@@ -335,7 +335,7 @@ EOF
test_expect_success \
'F: verify other commit' \
'git-cat-file commit other >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series G
@@ -413,7 +413,7 @@ echo "$file5_data" >expect
test_expect_success \
'H: verify file' \
'git-cat-file blob H:h/e/l/lo >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series I
@@ -439,7 +439,7 @@ EOF
test_expect_success \
'I: verify edge list' \
'sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
- diff -u expect actual'
+ git diff expect actual'
###
### series J
@@ -501,4 +501,54 @@ test_expect_success \
'test `git-rev-parse --verify branch^1` \
= `git-rev-parse --verify K^1`'
+###
+### series L
+###
+
+cat >input <<INPUT_END
+blob
+mark :1
+data <<EOF
+some data
+EOF
+
+blob
+mark :2
+data <<EOF
+other data
+EOF
+
+commit refs/heads/L
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+create L
+COMMIT
+
+M 644 :1 b.
+M 644 :1 b/other
+M 644 :1 ba
+
+commit refs/heads/L
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+update L
+COMMIT
+
+M 644 :2 b.
+M 644 :2 b/other
+M 644 :2 ba
+INPUT_END
+
+cat >expect <<EXPECT_END
+:100644 100644 4268632... 55d3a52... M b.
+:040000 040000 0ae5cac... 443c768... M b
+:100644 100644 4268632... 55d3a52... M ba
+EXPECT_END
+
+test_expect_success \
+ 'L: verify internal tree sorting' \
+ 'git-fast-import <input &&
+ git-diff --raw L^ L >output &&
+ git diff expect output'
+
test_done