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

[StGit PATCH] New test: "stg diff"

From
Karl Hasselström <kha@treskal.com>
Date
Oct 9, 2007, 04:42 UTC
Message-ID
<20071009044149.26624.11429.stgit@yoghurt>
In-Reply-To
<20071008153450.GA12247@diana.vm.bytemark.co.uk>

A simple test to make sure that we can run "stg diff" without arguments, just to list local changes.

Note that two subtests currently fail; these are due to plain "stg diff" failing on a branch where "stg init" hasn't been run, which is plainly a bug.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
On 2007-10-08 17:34:50 +0200, Karl Hasselström wrote:
> So, we don't have a single test that tries to run "stg diff". Duh.
 t/t2400-diff.sh |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100755 t/t2400-diff.sh
diff --git a/t/t2400-diff.sh b/t/t2400-diff.sh
new file mode 100755
index 0000000..6d9ed98
--- /dev/null
+++ b/t/t2400-diff.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+test_description='Run "stg diff"'
+
+. ./test-lib.sh
+
+test_expect_failure 'Diff with no StGit data' '
+    stg diff
+'
+
+test_expect_success 'Make some local changes' '
+    echo foo >> foo.txt &&
+    git add foo.txt
+'
+
+test_expect_failure 'Diff with some local changes' '
+    stg diff
+'
+
+test_expect_success 'Initialize StGit stuff' '
+    stg init &&
+    stg new foo -m foo
+'
+
+test_expect_success 'Diff with some local changes' '
+    stg diff
+'
+
+test_expect_success 'Refresh patch' '
+    stg refresh
+'
+
+test_expect_success 'Diff with no local changes' '
+    stg diff
+'
+
+test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 9 of 12 in “Survive capital punishment”
  1. 0/6 Survive capital punishmentKarl Hasselström, Oct 8, 2007
  2. 1/6 Allow caller to customize title of error/warning messageKarl Hasselström, Oct 8, 2007
  3. 2/6 Use our nice message printout wrapping systemKarl Hasselström, Oct 8, 2007
  4. 3/6 Properly detect that HEAD is detachedKarl Hasselström, Oct 8, 2007
  5. 4/6 Refactor crt_series creationKarl Hasselström, Oct 8, 2007
  6. 5/6 Don't have a global crt_series in stgit.commans.commonKarl Hasselström, Oct 8, 2007
  7. 6/6 Let some commands work with detached HEADKarl Hasselström, Oct 8, 2007
  8. Karl HasselströmOct 8, 2007
  9. New test: "stg diff"Karl Hasselström, Oct 9, 2007
  10. Karl HasselströmOct 9, 2007
  11. Karl HasselströmOct 8, 2007
  12. Karl HasselströmOct 8, 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.