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

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

 



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

---

 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

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