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

[StGit PATCH 2/2] New refresh tests

From
Karl Hasselström <kha@treskal.com>
Date
Jun 25, 2008, 04:30 UTC
Message-ID
<20080625043026.6044.72652.stgit@yoghurt>
In-Reply-To
<20080625042337.6044.53357.stgit@yoghurt>

Test stg refresh more extensively -- including some things it only recently learned to do.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t2300-refresh-subdir.sh |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh
index 92c1cc8..d731a11 100755
--- a/t/t2300-refresh-subdir.sh
+++ b/t/t2300-refresh-subdir.sh
@@ -4,7 +4,7 @@ test_description='Test the refresh command from a subdirectory'
 stg init
 
 test_expect_success 'Refresh from a subdirectory' '
-    stg new foo -m foo &&
+    stg new p0 -m p0 &&
     echo foo >> foo.txt &&
     mkdir bar &&
     echo bar >> bar/bar.txt &&
@@ -45,4 +45,31 @@ test_expect_success 'Refresh subdirectories recursively' '
     [ "$(stg status)" = "" ]
 '
 
+test_expect_success 'refresh -u' '
+    echo baz >> bar/baz.txt &&
+    stg new p1 -m p1 &&
+    git add bar/baz.txt &&
+    stg refresh --index &&
+    echo xyzzy >> foo.txt &&
+    echo xyzzy >> bar/bar.txt &&
+    echo xyzzy >> bar/baz.txt &&
+    stg refresh -u &&
+    test "$(echo $(stg status))" = "M bar/bar.txt M foo.txt"
+'
+
+test_expect_success 'refresh -u -p <subdir>' '
+    echo xyzzy >> bar/baz.txt &&
+    stg refresh -p p0 -u bar &&
+    test "$(echo $(stg status))" = "M bar/baz.txt M foo.txt"
+'
+
+test_expect_success 'refresh an unapplied patch' '
+    stg refresh -u &&
+    stg goto p0 &&
+    test "$(stg status)" = "M foo.txt" &&
+    stg refresh -p p1 &&
+    test "$(stg status)" = "" &&
+    test "$(echo $(stg files p1))" = "A bar/baz.txt M foo.txt"
+'
+
 test_done
Previous: Karl HasselströmNext: Catalin Marinas
Message 2 of 6 in “Convert "stg refresh" to the new infrastructure”
  1. 1/2 Convert "stg refresh" to the new infrastructureKarl Hasselström, Jun 25, 2008
  2. 2/2 New refresh testsKarl Hasselström, Jun 25, 2008
  3. Catalin MarinasJun 29, 2008
  4. Karl HasselströmJun 29, 2008
  5. Catalin MarinasJun 29, 2008
  6. Karl HasselströmJun 29, 2008

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.