summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2017-08-01 16:25:42 +0100
committerRichard Maw <richard.maw@gmail.com>2017-08-01 17:03:45 +0100
commitee9bc487e49b20884cb55f86c2c610a8c4ae0279 (patch)
tree94522d329557097429b6cb6d34556c91a8e3c1b0
parentea45bb9535fceea9c9feebde0360c594fc985fe1 (diff)
downloadgitano-ee9bc487e49b20884cb55f86c2c610a8c4ae0279.tar.gz
Add Yarn for testing dangling HEADrichardmaw/test-warn-dangling-head
-rw-r--r--Makefile3
-rw-r--r--testing/03-dangling-HEAD.yarn24
2 files changed, 26 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 258f831..d1d411d 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,8 @@ TESTS := 01-basics 01-hooks 02-commands-as 02-commands-config 02-commands-copy
02-commands-keyring \
02-commands-ls 02-commands-rename 02-commands-rsync \
02-commands-sshkey 02-commands-user 02-commands-whoami 03-cgit-support \
- 03-shallow-push 03-treedelta-rules 03-force-pushing
+ 03-shallow-push 03-treedelta-rules 03-force-pushing \
+ 03-dangling-HEAD
MODS := gitano \
diff --git a/testing/03-dangling-HEAD.yarn b/testing/03-dangling-HEAD.yarn
new file mode 100644
index 0000000..573b778
--- /dev/null
+++ b/testing/03-dangling-HEAD.yarn
@@ -0,0 +1,24 @@
+Being notified when a push does not fix a dangling HEAD
+-------------------------------------------------------
+
+Things can get confusing quickly when you've got a repository
+where the symbolic ref HEAD does not point to an existing branch.
+This is called a "dangling HEAD".
+
+Since Gitano allows you to change the HEAD symbolic ref from refs/heads/master
+it can be easier to accidentally leave it dangling after pushing a branch.
+
+To reduce the surprise involved, Gitano will provide a warning
+if after a push the HEAD symbolic ref is dangling.
+
+ SCENARIO Pushes resulting in a dangling HEAD are warned about
+
+ GIVEN a standard instance
+ WHEN testinstance adminkey runs create testrepo
+ AND testinstance adminkey runs config testrepo set project.head refs/heads/trunk
+ AND testinstance, using adminkey, clones testrepo as testrepo
+ AND testinstance applies add-a-FOO.patch in testrepo
+ AND testinstance, using adminkey, pushes testrepo to testrepo.git
+ THEN stderr contains WARNING: HEAD remains dangling
+
+ FINALLY the instance is torn down