Merge branch 'maint'
[gitweb.git] / t / t4013-diff-various.sh
index 3d85ceaae9e695d7b03d09cb082f1eef4f8406f2..1a6b52234d8df70e5ddcb28c0ddde582d8310d43 100755 (executable)
@@ -17,6 +17,7 @@ test_expect_success setup '
        export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
 
        mkdir dir &&
+       mkdir dir2 &&
        for i in 1 2 3; do echo $i; done >file0 &&
        for i in A B; do echo $i; done >dir/sub &&
        cat file0 >file2 &&
@@ -98,7 +99,7 @@ do
        test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
        cnt=`expr $test_count + 1`
        pfx=`printf "%04d" $cnt`
-       expect="../t4013/diff.$test"
+       expect="$TEST_DIRECTORY/t4013/diff.$test"
        actual="$pfx-diff.$test"
 
        test_expect_success "git $cmd" '
@@ -106,12 +107,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" &&
+                       test_cmp "$expect" "$actual" &&
                        rm -f "$actual"
                else
                        # this is to help developing new tests.
@@ -238,6 +239,13 @@ 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
+format-patch --inline --stdout --subject-prefix=TESTCASE initial..master
+config format.subjectprefix DIFFERENT_PREFIX
+format-patch --inline --stdout initial..master^^
+format-patch --stdout --cover-letter -n initial..master^
 
 diff --abbrev initial..side
 diff -r initial..side
@@ -248,6 +256,8 @@ diff --patch-with-stat initial..side
 diff --patch-with-raw initial..side
 diff --patch-with-stat -r initial..side
 diff --patch-with-raw -r initial..side
+diff --name-status dir2 dir
+diff --no-index --name-status dir2 dir
 EOF
 
 test_done