"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
clone.sh: adjust tautological check
To:
gameoftrees@openbsd.org
Date:
Fri, 10 Mar 2023 11:43:52 +0100

Download raw body.

Thread
we run got log twice on $testroot/repo *after* cloning, so (excluding
hypothetical corruptions caused by got log) log-repo and
log-repo-clone are identical.

Instead, run `got log' on the cloned repo and check that the cloned
log equals the remote one.  ok?

diff /home/op/w/got
commit - cee3836880940ba0d1203e0682a43a680132bc27
path + /home/op/w/got
blob - edb0516b38e63ce6695a517988a05d6c9a5266e3
file + regress/cmdline/clone.sh
--- regress/cmdline/clone.sh
+++ regress/cmdline/clone.sh
@@ -36,13 +36,10 @@ test_clone_basic() {
 		test_done "$testroot" "$ret"
 		return 1
 	fi
-	got log -l0 -p -r $testroot/repo > $testroot/log-repo-clone
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		echo "got log command failed unexpectedly" >&2
-		test_done "$testroot" "$ret"
-		return 1
-	fi
+	got log -l0 -p -r $testroot/repo-clone | \
+		sed 's@master, origin/master@master@g' \
+		> $testroot/log-repo-clone
+
 	cmp -s $testroot/log-repo $testroot/log-repo-clone
 	ret=$?
 	if [ $ret -ne 0 ]; then