A foo/bar
EOF
test_expect_success 'Status with an added file' '
- git add foo &&
+ stg add foo &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
test_expect_success 'Add another file' '
echo lajbans > fie &&
- git add fie &&
+ stg add fie &&
stg refresh
'
'
cat > expected.txt <<EOF
-? foo/bar.ancestor
-? foo/bar.current
-? foo/bar.patched
A fie
C foo/bar
EOF
test_expect_success 'Status after conflicting push' '
- ! stg push &&
+ conflict stg push &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
M foo/bar
EOF
test_expect_success 'Status after resolving the push' '
- stg resolved -a &&
+ stg add --update &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
test_expect_success 'Status of disappeared newborn' '
stg refresh &&
touch foo/bar &&
- git add foo/bar &&
+ stg add foo/bar &&
rm foo/bar &&
stg status > output.txt &&
test_cmp expected.txt output.txt
'
+cat > expected.txt <<EOF
+A fay
+D fie
+EOF
+test_expect_success 'Status after renaming a file' '
+ stg rm foo/bar &&
+ stg mv fie fay &&
+ stg status > output.txt &&
+ test_cmp expected.txt output.txt
+'
+
+test_expect_success 'Status after renaming a file (with rename detection)' '
+ git config stgit.diff-opts -M &&
+ stg status > output.txt &&
+ test_cmp expected.txt output.txt
+'
+
test_done