shithub: regress

Download patch

ref: 071991480396986f294993a26bc866d69521b54d
parent: 9a91d5b20e00cf2a74ef82aa0d6f1f4d847dc04f
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jul 18 12:20:32 EDT 2021

add basic git tests

ape/diff: b/cmd/git/null: No such file or directory
--- /dev/null	Mon Oct 18 12:05:45 2021
+++ b/cmd/git/git.rc	Sun Jul 18 12:20:32 2021
@@ -0,0 +1,57 @@
+#!/bin/rc
+
+pwd=`{pwd}
+rm -fr repo
+mkdir -p repo/upstream
+
+echo @@ version1 @@
+@{cd repo/upstream
+git/init
+echo version1 > file.txt
+git/add file.txt
+git/commit -m version1 file.txt
+}
+
+@{cd repo
+git/clone $pwd/repo/upstream downstream
+}
+
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+
+echo @@ version2 @@
+@{cd repo/upstream
+echo version2 > file.txt
+git/commit -m version2 file.txt
+}
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+
+echo @@ version3 @@
+@{cd repo/upstream
+echo version3 > file2.txt
+git/add file2.txt
+git/commit -m version3 file2.txt
+}
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+diff -c repo/upstream/file2.txt repo/downstream/file2.txt
+
+echo @@ version4 @@
+@{cd repo/upstream
+echo version4 > file.txt
+git/rm file2.txt
+rm file2.txt
+git/commit -m version4 file.txt file2.txt
+}
+
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+! test -e repo/upstream/file2.txt
+! test -e repo/downstream/file2.txt
+
--- /dev/null	Mon Oct 18 12:05:45 2021
+++ b/cmd/git/mkfile	Sun Jul 18 12:20:32 2021
@@ -0,0 +1,5 @@
+</$objtype/mkfile
+
+TEST=git
+
+<../../regress
--- /dev/null	Mon Oct 18 12:05:45 2021
+++ b/cmd/git/test.rc	Sun Jul 18 12:20:32 2021
@@ -0,0 +1,56 @@
+#!/bin/rc -e
+
+pwd=`{pwd}
+rm -fr repo
+mkdir -p repo/upstream
+
+echo version1
+
+@{cd repo/upstream
+git/init
+echo version1 > file.txt
+git/add file.txt
+git/commit -m version1 file.txt
+}
+
+@{cd repo
+git/clone $pwd/repo/upstream downstream
+}
+
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+
+echo version2
+@{cd repo/upstream
+echo version2 > file.txt
+git/commit -m version2 file.txt
+}
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+
+echo version3
+@{cd repo/upstream
+echo version3 > file2.txt
+git/add file2.txt
+git/commit -m version3 file2.txt
+}
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+diff -c repo/upstream/file2.txt repo/downstream/file2.txt
+
+echo version4
+@{cd repo/upstream
+echo version4 > file.txt
+git/rm file2.txt
+git/commit -m version4 file.txt file2.txt
+}
+
+@{cd repo/downstream
+git/pull
+}
+diff -c repo/upstream/file.txt repo/downstream/file.txt
+diff -c repo/upstream/file2.txt repo/downstream/file2.txt
+
--- a/cmd/mkfile	Sat Feb  6 19:44:06 2021
+++ b/cmd/mkfile	Sun Jul 18 12:20:32 2021
@@ -3,6 +3,7 @@
 TEST=\
 	cpp\
 	date\
+	git\
 	test\
 
 <../regress