about summary refs log tree commit diff
path: root/third_party/git/t/t4011-diff-symlink.sh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-25T23·06+0100
committerVincent Ambo <tazjin@google.com>2020-05-25T23·06+0100
commit93ba78d6f4632ef1c5228965e3edc8c0faf88c1e (patch)
tree85730c182a9f5f492ade8e8ccdb1c2356f9900bd /third_party/git/t/t4011-diff-symlink.sh
parent6f8fbf4aa4b1654ab27d4829e114538761817de0 (diff)
revert(3p/git): Revert merge of git upstream at v2.26.2 r/852
This causes cgit to serve error pages, which is undesirable.

This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing
changes made to f2b211131f2347342dde63975b09cf603149f1a3.
Diffstat (limited to 'third_party/git/t/t4011-diff-symlink.sh')
-rwxr-xr-xthird_party/git/t/t4011-diff-symlink.sh40
1 files changed, 12 insertions, 28 deletions
diff --git a/third_party/git/t/t4011-diff-symlink.sh b/third_party/git/t/t4011-diff-symlink.sh
index 717034bb50b5..5ae19b987d65 100755
--- a/third_party/git/t/t4011-diff-symlink.sh
+++ b/third_party/git/t/t4011-diff-symlink.sh
@@ -9,24 +9,11 @@ test_description='Test diff of symlinks.
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/diff-lib.sh
 
-# Print the short OID of a symlink with the given name.
-symlink_oid () {
-	local oid=$(printf "%s" "$1" | git hash-object --stdin) &&
-	git rev-parse --short "$oid"
-}
-
-# Print the short OID of the given file.
-short_oid () {
-	local oid=$(git hash-object "$1") &&
-	git rev-parse --short "$oid"
-}
-
 test_expect_success 'diff new symlink and file' '
-	symlink=$(symlink_oid xyzzy) &&
-	cat >expected <<-EOF &&
+	cat >expected <<-\EOF &&
 	diff --git a/frotz b/frotz
 	new file mode 120000
-	index 0000000..$symlink
+	index 0000000..7c465af
 	--- /dev/null
 	+++ b/frotz
 	@@ -0,0 +1 @@
@@ -34,7 +21,7 @@ test_expect_success 'diff new symlink and file' '
 	\ No newline at end of file
 	diff --git a/nitfol b/nitfol
 	new file mode 100644
-	index 0000000..$symlink
+	index 0000000..7c465af
 	--- /dev/null
 	+++ b/nitfol
 	@@ -0,0 +1 @@
@@ -59,10 +46,10 @@ test_expect_success 'diff unchanged symlink and file'  '
 '
 
 test_expect_success 'diff removed symlink and file' '
-	cat >expected <<-EOF &&
+	cat >expected <<-\EOF &&
 	diff --git a/frotz b/frotz
 	deleted file mode 120000
-	index $symlink..0000000
+	index 7c465af..0000000
 	--- a/frotz
 	+++ /dev/null
 	@@ -1 +0,0 @@
@@ -70,7 +57,7 @@ test_expect_success 'diff removed symlink and file' '
 	\ No newline at end of file
 	diff --git a/nitfol b/nitfol
 	deleted file mode 100644
-	index $symlink..0000000
+	index 7c465af..0000000
 	--- a/nitfol
 	+++ /dev/null
 	@@ -1 +0,0 @@
@@ -103,10 +90,9 @@ test_expect_success 'diff identical, but newly created symlink and file' '
 '
 
 test_expect_success 'diff different symlink and file' '
-	new=$(symlink_oid yxyyz) &&
-	cat >expected <<-EOF &&
+	cat >expected <<-\EOF &&
 	diff --git a/frotz b/frotz
-	index $symlink..$new 120000
+	index 7c465af..df1db54 120000
 	--- a/frotz
 	+++ b/frotz
 	@@ -1 +1 @@
@@ -115,7 +101,7 @@ test_expect_success 'diff different symlink and file' '
 	+yxyyz
 	\ No newline at end of file
 	diff --git a/nitfol b/nitfol
-	index $symlink..$new 100644
+	index 7c465af..df1db54 100644
 	--- a/nitfol
 	+++ b/nitfol
 	@@ -1 +1 @@
@@ -151,16 +137,14 @@ test_expect_success SYMLINKS 'setup symlinks with attributes' '
 '
 
 test_expect_success SYMLINKS 'symlinks do not respect userdiff config by path' '
-	file=$(short_oid file.bin) &&
-	link=$(symlink_oid file.bin) &&
-	cat >expect <<-EOF &&
+	cat >expect <<-\EOF &&
 	diff --git a/file.bin b/file.bin
 	new file mode 100644
-	index 0000000..$file
+	index 0000000..d95f3ad
 	Binary files /dev/null and b/file.bin differ
 	diff --git a/link.bin b/link.bin
 	new file mode 120000
-	index 0000000..$link
+	index 0000000..dce41ec
 	--- /dev/null
 	+++ b/link.bin
 	@@ -0,0 +1 @@