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

[StGit PATCH 1/2] Test "stg status" with renames

From
Karl Hasselström <kha@treskal.com>
Date
Jul 8, 2008, 19:54 UTC
Message-ID
<20080708195425.24866.58362.stgit@yoghurt>
In-Reply-To
<20080708195214.24866.61663.stgit@yoghurt>

Currently, it only works if -M is not passed to git diff-files, so the second of the two tests fails.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t0002-status.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index 43e1ca0..69c29a0 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -171,4 +171,20 @@ test_expect_success 'Status of disappeared newborn' '
     diff -u expected.txt output.txt
 '
 
+cat > expected.txt <<EOF
+A fay
+D fie
+EOF
+test_expect_success 'Status after renaming a file' '
+    git rm foo/bar &&
+    git mv fie fay &&
+    stg status > output.txt &&
+    diff -u expected.txt output.txt
+'
+
+test_expect_failure 'Status after renaming a file (with rename detection)' '
+    stg status --diff-opts=-M > output.txt &&
+    diff -u expected.txt output.txt
+'
+
 test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 4 in “stg status rename fix (stable)”
  1. 0/2 stg status rename fix (stable)Karl Hasselström, Jul 8, 2008
  2. 1/2 Test "stg status" with renamesKarl Hasselström, Jul 8, 2008
  3. 2/2 Don't allow extra diff options with "stg status"Karl Hasselström, Jul 8, 2008
  4. Karl HasselströmJul 9, 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.