chiark / gitweb /
Test "stg status" with renames
authorKarl Hasselström <kha@treskal.com>
Tue, 8 Jul 2008 18:18:50 +0000 (20:18 +0200)
committerKarl Hasselström <kha@treskal.com>
Tue, 8 Jul 2008 18:18:54 +0000 (20:18 +0200)
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@treskal.com>
t/t0002-status.sh

index 43e1ca08e4deba373408c9914cd04f85c545b3eb..69c29a08923a682a99629edcfd162554c45e95a1 100755 (executable)
@@ -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