+test_expect_success 'refresh -u' '
+ echo baz >> bar/baz.txt &&
+ stg new p1 -m p1 &&
+ git add bar/baz.txt &&
+ stg refresh --index &&
+ echo xyzzy >> foo.txt &&
+ echo xyzzy >> bar/bar.txt &&
+ echo xyzzy >> bar/baz.txt &&
+ stg refresh -u &&
+ test "$(echo $(stg status))" = "M bar/bar.txt M foo.txt"
+'
+
+test_expect_success 'refresh -u -p <subdir>' '
+ echo xyzzy >> bar/baz.txt &&
+ stg refresh -p p0 -u bar &&
+ test "$(echo $(stg status))" = "M bar/baz.txt M foo.txt"
+'
+
+test_expect_success 'refresh an unapplied patch' '
+ stg refresh -u &&
+ stg goto --keep p0 &&
+ test "$(stg status)" = "M foo.txt" &&
+ stg refresh -p p1 &&
+ test "$(stg status)" = "" &&
+ test "$(echo $(stg files p1))" = "A bar/baz.txt M foo.txt"
+'
+