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

[StGit PATCH 3/5] Simple test for "stg clean"

From
Karl Hasselström <kha@treskal.com>
Date
Nov 5, 2007, 03:14 UTC
Message-ID
<20071105031448.6108.90948.stgit@yoghurt>
In-Reply-To
<20071105030847.6108.44653.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t2500-clean.sh |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100755 t/t2500-clean.sh
diff --git a/t/t2500-clean.sh b/t/t2500-clean.sh
new file mode 100755
index 0000000..3364c18
--- /dev/null
+++ b/t/t2500-clean.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+test_description='Run "stg clean"'
+
+. ./test-lib.sh
+
+test_expect_success 'Initialize StGit stack' '
+    stg init &&
+    stg new e0 -m e0 &&
+    stg new p0 -m p0 &&
+    echo foo > foo.txt &&
+    git add foo.txt &&
+    stg refresh &&
+    stg new e1 -m e1 &&
+    stg new e2 -m e2 &&
+    stg pop
+'
+
+test_expect_success 'Clean empty patches' '
+    [ "$(echo $(stg applied))" = "e0 p0 e1" ] &&
+    [ "$(echo $(stg unapplied))" = "e2" ] &&
+    stg clean &&
+    [ "$(echo $(stg applied))" = "p0" ] &&
+    [ "$(echo $(stg unapplied))" = "" ]
+'
+
+test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 4 of 6 in “Start the refactoring”
  1. 0/5 Start the refactoringKarl Hasselström, Nov 5, 2007
  2. 1/5 New StGit core infrastructure: repository operationsKarl Hasselström, Nov 5, 2007
  3. 2/5 Write metadata files used by the old infrastructureKarl Hasselström, Nov 5, 2007
  4. 3/5 Simple test for "stg clean"Karl Hasselström, Nov 5, 2007
  5. 4/5 Let "stg clean" use the new infrastructureKarl Hasselström, Nov 5, 2007
  6. 5/5 Add "stg coalesce"Karl Hasselström, Nov 5, 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.