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

[PATCH 2/2] Test the 'stg rename' command

From
Onno Kortmann <onno@gmx.net>
Date
Feb 21, 2008, 21:43 UTC
Message-ID
<200802212243.18922.onno@gmx.net>
In-Reply-To
<20080218140005.GA18668@diana.vm.bytemark.co.uk>
This just tests the few basic cases of the stg rename command.
Signed-off-by: Onno Kortmann <onno@gmx.net>
---
 t/t2900-rename.sh |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)
 create mode 100755 t/t2900-rename.sh
diff --git a/t/t2900-rename.sh b/t/t2900-rename.sh
new file mode 100755
index 0000000..a8f8f0b
--- /dev/null
+++ b/t/t2900-rename.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 Onno Kortmann
+# Parts taken from the other test scripts
+# in this directory.
+#
+
+test_description='stg rename test
+
+Tests some parts of the stg rename command.'
+
+. ./test-lib.sh
+stg init
+
+test_expect_success 'Rename in empty' '
+   ! stg rename foo
+'
+
+test_expect_success 'Rename single top-most' '
+   stg new -m foo
+   stg rename bar
+'
+# bar
+
+test_expect_success 'Rename non-existing' '
+   ! stg rename neithersuchpatch norsuchpatch
+'
+
+test_expect_success 'Rename with two arguments' '
+   stg new -m baz
+   stg rename bar foo
+'
+# foo,baz
+
+test_expect_success 'Rename to existing name' '
+   ! stg rename foo baz
+'
+
+test_expect_success 'Rename to same name' '
+   ! stg rename foo foo
+'
+
+test_expect_success 'Rename top-most when others exist' '
+   stg rename bar
+'
+
+test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 9 of 10 in “Allow renaming of the top-most branch by just calling stg rename <new-patch-name>”
  1. Allow renaming of the top-most branch by just calling stg rename <new-patch-name>Onno Kortmann, Feb 17, 2008
  2. Karl HasselströmFeb 18, 2008
  3. Onno KortmannFeb 21, 2008
  4. Karl HasselströmFeb 22, 2008
  5. Onno KortmannFeb 22, 2008
  6. Karl HasselströmFeb 23, 2008
  7. 1/2 Simple rename of top-most patchOnno Kortmann, Feb 21, 2008
  8. Karl HasselströmFeb 22, 2008
  9. 2/2 Test the 'stg rename' commandOnno Kortmann, Feb 21, 2008
  10. Karl HasselströmFeb 22, 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.