Make "stg refresh" subdirectory safe by letting it internally cd up to
the top of the worktree. This is possibly not the best long-term fix;
one could argue that the refresh subroutine should instead be safe to
run from a subdirectory. However, refreshing from a subdirectory
currently only refreshes changes that are in the index, and not
changes in the working directory, and that has to be fixed.
Signed-off-by: Karl Hasselström <kha@treskal.com>
created with a different tool but the changes need to be included in
the current patch."""
-directory = DirectoryHasRepository()
+directory = DirectoryGotoToplevel()
options = [make_option('-f', '--force',
help = 'force the refresh even if HEAD and '\
'top differ',
[ "$(stg status)" = "" ]
'
-test_expect_failure 'Refresh again' '
+test_expect_success 'Refresh again' '
echo foo2 >> foo.txt &&
echo bar2 >> bar/bar.txt &&
cd bar &&