summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/02-commands-copy.yarn24
-rw-r--r--testing/library.yarn10
2 files changed, 32 insertions, 2 deletions
diff --git a/testing/02-commands-copy.yarn b/testing/02-commands-copy.yarn
index f282cb0..ee5c48f 100644
--- a/testing/02-commands-copy.yarn
+++ b/testing/02-commands-copy.yarn
@@ -1 +1,25 @@
<!-- -*- markdown -*- -->
+
+You may want to copy a repository from one place on the server
+to another place on the same server,
+since access control is repository based
+and another user of the server may want to push their own branches.
+
+This can be accomplished by:
+
+1. Creating the destination repository.
+2. Cloning the source repository locally.
+3. Pushing the local clone to the destination repository.
+
+This requires many round trips
+and sending the entire repository's contents across the internet twice,
+so there's use for server-side clone operation.
+
+ SCENARIO server-side clone
+ GIVEN a standard instance
+
+Users may copy repositories they can read to paths they can write to.
+
+ WHEN testinstance adminkey runs copy gitano-admin public/testrepo
+ THEN server-side public/testrepo has identical refs to gitano-admin
+ AND server-side public/testrepo has no missing objects
diff --git a/testing/library.yarn b/testing/library.yarn
index bda2aa5..a0bb6e2 100644
--- a/testing/library.yarn
+++ b/testing/library.yarn
@@ -40,10 +40,16 @@ Repository access
Server-side repository checking for behind-the-scenes work
----------------------------------------------------------
- IMPLEMENTS THEN server-side ([^ ]+) file ([^ ]+) contains (.+)
- cd "$($GTT serverlocation $MATCH_1)"
+ IMPLEMENTS THEN server-side ([^ ]+) file ([^ ]+) contains (.+)
+ cd "$($GTT serverlocation $MATCH_1)"
grep -q "$MATCH_3" "$MATCH_2"
+ IMPLEMENTS THEN server-side ([^ ]+) has identical refs to ([^ ]+)
+ bash -c 'diff -u <(git ls-remote -ht "$($GTT serverlocation "$MATCH_1")" | sort -k2) <(git ls-remote -ht "$($GTT serverlocation "$MATCH_2")" | sort -k2)'
+
+ IMPLEMENTS THEN server-side ([^ ]+) has no missing objects
+ cd "$($GTT serverlocation $MATCH_1)".git
+ git fsck
Clone manipulation
------------------