[StGit PATCH 4/4] Add simple test for "stg branch --delete"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>

---

 t/t1005-branch-delete.sh |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100755 t/t1005-branch-delete.sh


diff --git a/t/t1005-branch-delete.sh b/t/t1005-branch-delete.sh
new file mode 100755
index 0000000..7a0872e
--- /dev/null
+++ b/t/t1005-branch-delete.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+test_description='Attempt to delete branches'
+
+. ./test-lib.sh
+
+stg init
+
+test_expect_success 'Create a branch (and switch to it)' '
+    stg branch --create foo
+    '
+
+test_expect_success 'Delete a branch' '
+    stg branch --delete master
+    '
+
+test_expect_success 'Make sure the branch ref was deleted' '
+    [ -z "$(git show-ref | grep master | tee /dev/stderr)" ]
+    '
+
+test_expect_success 'Make sure the branch config was deleted' '
+    [ -z "$(git config -l | grep branch\\.master | tee /dev/stderr)" ]
+    '
+
+test_expect_success 'Make sure the branch files were deleted' '
+    [ -z "$(find .git -type f | grep master | tee /dev/stderr)" ]
+    '
+
+test_done

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux