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

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

From
Karl Hasselström <kha@treskal.com>
Date
Nov 11, 2007, 19:43 UTC
Message-ID
<20071111194334.18868.87832.stgit@yoghurt>
In-Reply-To
<20071111193545.18868.62490.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 2 of 8 in “A few small fixes”
  1. 0/5 A few small fixesKarl Hasselström, Nov 11, 2007
  2. 1/5 Simple test for "stg clean"Karl Hasselström, Nov 11, 2007
  3. 2/5 Cogito is deprecated, so don't point to itKarl Hasselström, Nov 11, 2007
  4. 3/5 Let some commands work with detached HEADKarl Hasselström, Nov 11, 2007
  5. 4/5 Rename "stg assimilate" to "stg repair"Karl Hasselström, Nov 11, 2007
  6. 5/5 stg repair: Patchify non-patch commits between patchesKarl Hasselström, Nov 11, 2007
  7. Catalin MarinasNov 12, 2007
  8. Karl HasselströmNov 12, 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.