about summary refs log tree commit diff
path: root/third_party/git/t/t6120-describe.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/t6120-describe.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/t6120-describe.sh')
-rwxr-xr-xthird_party/git/t/t6120-describe.sh138
1 files changed, 16 insertions, 122 deletions
diff --git a/third_party/git/t/t6120-describe.sh b/third_party/git/t/t6120-describe.sh
index 34502e3a5054..2b883d817403 100755
--- a/third_party/git/t/t6120-describe.sh
+++ b/third_party/git/t/t6120-describe.sh
@@ -1,27 +1,28 @@
 #!/bin/sh
 
-test_description='test describe'
-
-#  o---o-----o----o----o-------o----x
-#       \   D,R   e           /
-#        \---o-------------o-'
-#         \  B            /
-#          `-o----o----o-'
-#                 A    c
-#
-# First parent of a merge commit is on the same line, second parent below.
+test_description='test describe
 
+                       B
+        .--------------o----o----o----x
+       /                   /    /
+ o----o----o----o----o----.    /
+       \        A    c        /
+        .------------o---o---o
+                   D,R   e
+'
 . ./test-lib.sh
 
 check_describe () {
 	expect="$1"
 	shift
-	describe_opts="$@"
-	test_expect_success "describe $describe_opts" '
-	R=$(git describe $describe_opts 2>err.actual) &&
+	R=$(git describe "$@" 2>err.actual)
+	S=$?
+	cat err.actual >&3
+	test_expect_success "describe $*" '
+	test $S = 0 &&
 	case "$R" in
 	$expect)	echo happy ;;
-	*)	echo "Oops - $R is not $expect" &&
+	*)	echo "Oops - $R is not $expect";
 		false ;;
 	esac
 	'
@@ -381,7 +382,7 @@ test_expect_success 'describe tag object' '
 	test_i18ngrep "fatal: test-blob-1 is neither a commit nor blob" actual
 '
 
-test_expect_success ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
+test_expect_failure ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
 	i=1 &&
 	while test $i -lt 8000
 	do
@@ -423,111 +424,4 @@ test_expect_success 'describe complains about missing object' '
 	test_must_fail git describe $ZERO_OID
 '
 
-test_expect_success 'name-rev a rev shortly after epoch' '
-	test_when_finished "git checkout master" &&
-
-	git checkout --orphan no-timestamp-underflow &&
-	# Any date closer to epoch than the CUTOFF_DATE_SLOP constant
-	# in builtin/name-rev.c.
-	GIT_COMMITTER_DATE="@1234 +0000" \
-	git commit -m "committer date shortly after epoch" &&
-	old_commit_oid=$(git rev-parse HEAD) &&
-
-	echo "$old_commit_oid no-timestamp-underflow" >expect &&
-	git name-rev $old_commit_oid >actual &&
-	test_cmp expect actual
-'
-
-# A--------------master
-#  \            /
-#   \----------M2
-#    \        /
-#     \---M1-C
-#      \ /
-#       B
-test_expect_success 'name-rev covers all conditions while looking at parents' '
-	git init repo &&
-	(
-		cd repo &&
-
-		echo A >file &&
-		git add file &&
-		git commit -m A &&
-		A=$(git rev-parse HEAD) &&
-
-		git checkout --detach &&
-		echo B >file &&
-		git commit -m B file &&
-		B=$(git rev-parse HEAD) &&
-
-		git checkout $A &&
-		git merge --no-ff $B &&  # M1
-
-		echo C >file &&
-		git commit -m C file &&
-
-		git checkout $A &&
-		git merge --no-ff HEAD@{1} && # M2
-
-		git checkout master &&
-		git merge --no-ff HEAD@{1} &&
-
-		echo "$B master^2^2~1^2" >expect &&
-		git name-rev $B >actual &&
-
-		test_cmp expect actual
-	)
-'
-
-#               B
-#               o
-#                \
-#  o-----o---o----x
-#        A
-#
-test_expect_success 'describe commits with disjoint bases' '
-	git init disjoint1 &&
-	(
-		cd disjoint1 &&
-
-		echo o >> file && git add file && git commit -m o &&
-		echo A >> file && git add file && git commit -m A &&
-		git tag A -a -m A &&
-		echo o >> file && git add file && git commit -m o &&
-
-		git checkout --orphan branch && rm file &&
-		echo B > file2 && git add file2 && git commit -m B &&
-		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
-
-		check_describe "A-3-*" HEAD
-	)
-'
-
-#           B
-#   o---o---o------------.
-#                         \
-#                  o---o---x
-#                  A
-#
-test_expect_success 'describe commits with disjoint bases 2' '
-	git init disjoint2 &&
-	(
-		cd disjoint2 &&
-
-		echo A >> file && git add file && GIT_COMMITTER_DATE="2020-01-01 18:00" git commit -m A &&
-		git tag A -a -m A &&
-		echo o >> file && git add file && GIT_COMMITTER_DATE="2020-01-01 18:01" git commit -m o &&
-
-		git checkout --orphan branch &&
-		echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:00" git commit -m o &&
-		echo o >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:01" git commit -m o &&
-		echo B >> file2 && git add file2 && GIT_COMMITTER_DATE="2020-01-01 15:02" git commit -m B &&
-		git tag B -a -m B &&
-		git merge --no-ff --allow-unrelated-histories master -m x &&
-
-		check_describe "B-3-*" HEAD
-	)
-'
-
 test_done