git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGit PATCH 2/2] New refresh tests
Date: Wed, 25 Jun 2008 06:30:33 +0200	[thread overview]
Message-ID: <20080625043026.6044.72652.stgit@yoghurt> (raw)
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

  reply	other threads:[~2008-06-25  4:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25  4:30 [StGit PATCH 1/2] Convert "stg refresh" to the new infrastructure Karl Hasselström
2008-06-25  4:30 ` Karl Hasselström [this message]
2008-06-29  9:42 ` Catalin Marinas
2008-06-29 10:21   ` Karl Hasselström
2008-06-29 11:07     ` Catalin Marinas
2008-06-29 13:46       ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080625043026.6044.72652.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).