Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t4045: abstract away SHA-1-specific constants
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 21 May 2018 02:01:45 +0000
(
02:01
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 21 May 2018 04:55:48 +0000
(13:55 +0900)
Adjust the test so that it computes variables for blobs instead of using
hard-coded hashes.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4045-diff-relative.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e4c5652
)
diff --git
a/t/t4045-diff-relative.sh
b/t/t4045-diff-relative.sh
index 6471a68701dd4bc140d43ba91ebb899036ae0d4d..36f8ed8a818714abc234ca940a59693f4be21046 100755
(executable)
--- a/
t/t4045-diff-relative.sh
+++ b/
t/t4045-diff-relative.sh
@@
-8,6
+8,7
@@
test_expect_success 'setup' '
echo content >file1 &&
mkdir subdir &&
echo other content >subdir/file2 &&
echo content >file1 &&
mkdir subdir &&
echo other content >subdir/file2 &&
+ blob=$(git hash-object subdir/file2) &&
git add . &&
git commit -m one
'
git add . &&
git commit -m one
'
@@
-17,10
+18,11
@@
check_diff () {
shift
expect=$1
shift
shift
expect=$1
shift
+ short_blob=$(git rev-parse --short $blob)
cat >expected <<-EOF
diff --git a/$expect b/$expect
new file mode 100644
cat >expected <<-EOF
diff --git a/$expect b/$expect
new file mode 100644
- index 0000000..
25c05ef
+ index 0000000..
$short_blob
--- /dev/null
+++ b/$expect
@@ -0,0 +1 @@
--- /dev/null
+++ b/$expect
@@ -0,0 +1 @@
@@
-68,7
+70,7
@@
check_raw () {
expect=$1
shift
cat >expected <<-EOF
expect=$1
shift
cat >expected <<-EOF
- :000000 100644 0000000000000000000000000000000000000000
25c05ef3639d2d270e7fe765a67668f098092bc5 A
$expect
+ :000000 100644 0000000000000000000000000000000000000000
$blob A
$expect
EOF
test_expect_success "--raw $*" "
git -C '$dir' diff --no-abbrev --raw $* HEAD^ >actual &&
EOF
test_expect_success "--raw $*" "
git -C '$dir' diff --no-abbrev --raw $* HEAD^ >actual &&