stg new p0 -m "base" &&
for i in 1 2 3; do
echo base >> foo$i.txt &&
- git add foo$i.txt
+ stg add foo$i.txt
done
stg refresh &&
for i in 1 2 3; do
stg status &&
test -z "$(stg status)" &&
stg patches foo3.txt > patches.txt &&
- diff -u expected.txt patches.txt
+ test_cmp expected.txt patches.txt
'
cat > expected.txt <<EOF
stg status &&
test -z "$(stg status)" &&
stg patches foo2.txt > patches.txt &&
- diff -u expected.txt patches.txt
+ test_cmp expected.txt patches.txt
'
cat > expected.txt <<EOF
stg status &&
test -z "$(stg status)" &&
stg patches foo1.txt > patches.txt &&
- diff -u expected.txt patches.txt
+ test_cmp expected.txt patches.txt
'
cat > expected.txt <<EOF
stg status &&
stg new p4 -m "refresh_index" &&
echo baz 1 >> foo1.txt &&
- git add foo1.txt &&
+ stg add foo1.txt &&
echo blah 1 >> foo1.txt &&
echo baz 2 >> foo2.txt &&
stg refresh --index &&
stg patches foo1.txt > patches.txt &&
git diff HEAD^..HEAD > show.txt &&
stg diff > diff.txt &&
- diff -u expected.txt patches.txt &&
- diff -u expected2.txt show.txt &&
- diff -u expected3.txt diff.txt &&
+ test_cmp expected.txt patches.txt &&
+ test_cmp expected2.txt show.txt &&
+ test_cmp expected3.txt diff.txt &&
stg new p5 -m "cleanup again" &&
stg refresh
'
+
+test_expect_success 'Refresh moved files' '
+ stg mv foo1.txt foo1-new.txt &&
+ stg refresh
+'
+
test_done