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

[StGit PATCH 4/5] New test: try "stg refresh" in a subdirectory

From
Karl Hasselström <kha@treskal.com>
Date
Oct 7, 2007, 23:25 UTC
Message-ID
<20071007232500.13070.5063.stgit@yoghurt>
In-Reply-To
<20071007231949.13070.49517.stgit@yoghurt>

Currently, it doesn't work. Or rather, it does work for changes that are already in the index, which is the case for newly added files; but it doesn't work for changes that aren't in the index.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t2300-refresh-subdir.sh |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100755 t/t2300-refresh-subdir.sh
diff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh
new file mode 100755
index 0000000..d1c7168
--- /dev/null
+++ b/t/t2300-refresh-subdir.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+test_description='Test the refresh command from a subdirectory'
+. ./test-lib.sh
+stg init
+
+test_expect_success 'Refresh from a subdirectory' '
+    stg new foo -m foo &&
+    echo foo >> foo.txt &&
+    mkdir bar &&
+    echo bar >> bar/bar.txt &&
+    stg add foo.txt bar/bar.txt &&
+    cd bar &&
+    stg refresh &&
+    cd .. &&
+    [ "$(stg status)" = "" ]
+'
+
+test_expect_failure 'Refresh again' '
+    echo foo2 >> foo.txt &&
+    echo bar2 >> bar/bar.txt &&
+    cd bar &&
+    stg refresh &&
+    cd .. &&
+    [ "$(stg status)" = "" ]
+'
+
+test_done
Previous: Karl HasselströmNext: Karl Hasselström
Message 5 of 6 in “Make push and refresh subdirectory safe”
  1. 0/5 Make push and refresh subdirectory safeKarl Hasselström, Oct 7, 2007
  2. 1/5 Infrastructure for current directory handlingKarl Hasselström, Oct 7, 2007
  3. 2/5 New test: Try "stg push" in a subdirectoryKarl Hasselström, Oct 7, 2007
  4. 3/5 Make "stg push" subdirectory safeKarl Hasselström, Oct 7, 2007
  5. 4/5 New test: try "stg refresh" in a subdirectoryKarl Hasselström, Oct 7, 2007
  6. 5/5 Make "stg refresh" subdirectory safeKarl Hasselström, Oct 7, 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.