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

[StGit PATCH 1/3] Test for exit code with command_error()

From
Karl Hasselström <kha@treskal.com>
Date
Jul 25, 2008, 00:52 UTC
Message-ID
<20080725005254.13006.49490.stgit@yoghurt>
In-Reply-To
<20080725005154.13006.8908.stgit@yoghurt>
The helper function was made for occasions such as this, so use it.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t1300-uncommit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh
index a906d13..a657ead 100755
--- a/t/t1300-uncommit.sh
+++ b/t/t1300-uncommit.sh
@@ -79,7 +79,7 @@ test_expect_success \
 '
 
 test_expect_success 'Uncommit a commit with not precisely one parent' '
-    stg uncommit -n 5 ; [ $? = 2 ] &&
+    command_error stg uncommit -n 5  &&
     [ "$(echo $(stg series))" = "" ]
 '
 
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 4 in “Fix uncommit with top != head”
  1. 0/3 Fix uncommit with top != headKarl Hasselström, Jul 25, 2008
  2. 1/3 Test for exit code with command_error()Karl Hasselström, Jul 25, 2008
  3. 2/3 stg uncommit should never touch the branch headKarl Hasselström, Jul 25, 2008
  4. 3/3 Make sure that stg uncommit doesn't touch the branch headKarl Hasselström, Jul 25, 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.