git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Karl Hasselström <kha@treskal.com>
Date
Sep 22, 2007, 08:46 UTC
Message-ID
<20070922084636.29884.36503.stgit@yoghurt>
In-Reply-To
<20070922084334.29884.60506.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 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
Previous: Karl Hasselström
Message 7 of 7 in “stg branch --delete doesn't work”
  1. Aneesh KumarSep 21, 2007
  2. Karl HasselströmSep 21, 2007
  3. 0/4 Fix "stg branch --delete"Karl Hasselström, Sep 22, 2007
  4. 1/4 Don't special-case the "master" branch during branch deleteKarl Hasselström, Sep 22, 2007
  5. 2/4 Don't try to delete the branch twiceKarl Hasselström, Sep 22, 2007
  6. 3/4 Properly remove all config for a deleted branchKarl Hasselström, Sep 22, 2007
  7. 4/4 Add simple test for "stg branch --delete"Karl Hasselström, Sep 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.