summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 902f235)
raw | patch | inline | side by side (parent: 902f235)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 20 Sep 2009 18:10:14 +0000 (11:10 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 4 Jan 2010 05:17:16 +0000 (21:17 -0800) |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/t/diff-lib.sh b/t/diff-lib.sh
index 4bddeb591ecc17ec532164d0d6cf1ad1a54eb996..75a35fcd0699940aea51534b5fe954847bed7bb9 100644 (file)
--- a/t/diff-lib.sh
+++ b/t/diff-lib.sh
:
-_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"
sanitize_diff_raw='/^:/s/ '"$_x40"' '"$_x40"' \([A-Z]\)[0-9]* / X X \1# /'
compare_diff_raw () {
# When heuristics are improved, the score numbers would change.
index 22ba7a5442c587f4536aad5668df43661231de56..4f171722d9e1dda7668f54b4104267eb70d91c67 100755 (executable)
100644 X 0 Z/NN
EOF
-_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"
-
check_result () {
git ls-files --stage | sed -e 's/ '"$_x40"' / X /' >current &&
test_cmp expected current
index c2d408b46120ef9d962272b652a68a83ba0852a5..6327d205cb89b00e77502031e3b56b4b895cc32d 100755 (executable)
git read-tree -m "$1" "$2" && git ls-files --stage
}
-_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"
compare_change () {
sed -n >current \
-e '/^--- /d; /^+++ /d; /^@@ /d;' \
index 5e40cec530df07a8b7c088d31b28ac2d39abdc1b..0241329a08af0be642131ffe4b619231d9ea3844 100755 (executable)
'
. ./test-lib.sh
-_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"
compare_change () {
sed >current \
-e '1{/^diff --git /d;}' \
index ee60d03fe8a582100e9df5511f6fea8900bcc543..eee0d344d24623ad9928366729c8efaea699fcd7 100755 (executable)
tree=`git write-tree` &&
echo $tree'
-_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
test_cmp expected check
index 8be9fb411276e3c416374a813d691ff0455a8746..06654c6f82fb6cfe955b91bcbd4a5fa064c73e70 100755 (executable)
tree=`git write-tree` &&
echo $tree'
-_x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index 8c1b81e248bced2ccb5e4ff0067996462e89deb8..ff8c2f7532aa6fd748dbbdc0322384576f3a35ed 100755 (executable)
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
'test_chmod +x rezrov &&
git diff-index $tree >current'
-_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"
sed -e 's/\(:100644 100755\) \('"$_x40"'\) \2 /\1 X X /' <current >check
echo ":100644 100755 X X M rezrov" >expected
index 510bb9679f29c10645c902caea020651a797aa2f..af34a1e81711ca183680c9882353bd786b55e79f 100755 (executable)
git tag "$1"
}
-_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"
-
unnote () {
git name-rev --tags --stdin | sed -e "s|$_x40 (tags/\([^)]*\)) |\1 |g"
}
diff --git a/t/test-lib.sh b/t/test-lib.sh
index ec3336aba5a65a468bc6ce71f33a9cca76dbfe0f..05efe1faa337d94fc775b06ce7af432d5cea793a 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
;;
esac
+# Convenience
+#
+# A regexp to match 5 and 40 hexdigits
+_x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
+_x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
+
# Each test should start with something like this, after copyright notices:
#
# test_description='Description of this test...