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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>

---

 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux