Make push and refresh subdirectory safe
cover Make push and refresh subdirectory safe
This series makes push and refresh safe to use from subdirectories, by using the infrastructure of the first patch to cd to the top of the worktree.
As stated in the commit messages, this may not be an optimal long-term solution, but we need to fix this quick. And the infrastructure isn't good only for cd'ing to the top of the worktree.
This series is also available from
git://repo.or.cz/stgit/kha.git safe
---
Karl Hasselström (5):
Make "stg refresh" subdirectory safe New test: try "stg refresh" in a subdirectory Make "stg push" subdirectory safe
New test: Try "stg push" in a subdirectory Infrastructure for current directory handling
stgit/commands/add.py | 1 + stgit/commands/applied.py | 1 + stgit/commands/assimilate.py | 1 + stgit/commands/branch.py | 1 + stgit/commands/clean.py | 1 + stgit/commands/clone.py | 1 + stgit/commands/commit.py | 1 + stgit/commands/common.py | 68 ++++++++++++++++++++++++++++++++++++++++++ stgit/commands/copy.py | 1 + stgit/commands/delete.py | 1 + stgit/commands/diff.py | 1 + stgit/commands/edit.py | 1 + stgit/commands/export.py | 1 + stgit/commands/files.py | 1 + stgit/commands/float.py | 1 + stgit/commands/fold.py | 1 + stgit/commands/goto.py | 1 + stgit/commands/hide.py | 1 + stgit/commands/id.py | 1 + stgit/commands/imprt.py | 1 + stgit/commands/init.py | 1 + stgit/commands/log.py | 1 + stgit/commands/mail.py | 1 + stgit/commands/new.py | 1 + stgit/commands/patches.py | 1 + stgit/commands/pick.py | 1 + stgit/commands/pop.py | 1 + stgit/commands/pull.py | 1 + stgit/commands/push.py | 1 + stgit/commands/rebase.py | 1 + stgit/commands/refresh.py | 1 + stgit/commands/rename.py | 1 + stgit/commands/resolved.py | 1 + stgit/commands/rm.py | 1 + stgit/commands/series.py | 1 + stgit/commands/show.py | 1 + stgit/commands/sink.py | 1 + stgit/commands/status.py | 1 + stgit/commands/sync.py | 1 + stgit/commands/top.py | 1 + stgit/commands/unapplied.py | 1 + stgit/commands/uncommit.py | 1 + stgit/commands/unhide.py | 1 + stgit/main.py | 2 + t/t1205-push-subdir.sh | 55 ++++++++++++++++++++++++++++++++++ t/t2300-refresh-subdir.sh | 27 +++++++++++++++++ 46 files changed, 194 insertions(+), 0 deletions(-) create mode 100755 t/t1205-push-subdir.sh create mode 100755 t/t2300-refresh-subdir.sh
Signature · 2 lines
Karl Hasselström, [email protected] www.treskal.com/kalle
PATCH 1/5 Infrastructure for current directory handling
Add infrastructure to allow commands to specify if they need a git repository, if they need to be called from within the working tree, and if they should cd to the root of the working tree before doing anything else.
For now, all commands are set to just require a repository (except "stg clone", which is set to require nothing), which means the only thing that's added is some very light error checking. The idea is to tighten this for commands that turn out to need it.
---
stgit/commands/add.py | 1 + stgit/commands/applied.py | 1 + stgit/commands/assimilate.py | 1 + stgit/commands/branch.py | 1 + stgit/commands/clean.py | 1 + stgit/commands/clone.py | 1 + stgit/commands/commit.py | 1 + stgit/commands/common.py | 68 ++++++++++++++++++++++++++++++++++++++++++ stgit/commands/copy.py | 1 + stgit/commands/delete.py | 1 + stgit/commands/diff.py | 1 + stgit/commands/edit.py | 1 + stgit/commands/export.py | 1 + stgit/commands/files.py | 1 + stgit/commands/float.py | 1 + stgit/commands/fold.py | 1 + stgit/commands/goto.py | 1 + stgit/commands/hide.py | 1 + stgit/commands/id.py | 1 + stgit/commands/imprt.py | 1 + stgit/commands/init.py | 1 + stgit/commands/log.py | 1 + stgit/commands/mail.py | 1 + stgit/commands/new.py | 1 + stgit/commands/patches.py | 1 + stgit/commands/pick.py | 1 + stgit/commands/pop.py | 1 + stgit/commands/pull.py | 1 + stgit/commands/push.py | 1 + stgit/commands/rebase.py | 1 + stgit/commands/refresh.py | 1 + stgit/commands/rename.py | 1 + stgit/commands/resolved.py | 1 + stgit/commands/rm.py | 1 + stgit/commands/series.py | 1 + stgit/commands/show.py | 1 + stgit/commands/sink.py | 1 + stgit/commands/status.py | 1 + stgit/commands/sync.py | 1 + stgit/commands/top.py | 1 + stgit/commands/unapplied.py | 1 + stgit/commands/uncommit.py | 1 + stgit/commands/unhide.py | 1 + stgit/main.py | 2 + 44 files changed, 112 insertions(+), 0 deletions(-)
stgit/commands/add.py +1 -0
@@ -31,6 +31,7 @@ Add the files or directories passed as arguments to the repository. When a directory name is given, all the files and subdirectories are recursively added.""" +directory = DirectoryHasRepository() options = []
stgit/commands/applied.py +1 -0
@@ -32,6 +32,7 @@ List the patches from the series which were already pushed onto the stack. They are listed in the order in which they were pushed, the last one being the current (topmost) patch.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one'), make_option('-c', '--count',
stgit/commands/assimilate.py +1 -0
@@ -53,6 +53,7 @@ Note that these are "inconsistencies", not "errors"; furthermore, with the way "assimilate" handles them, you have no reason to avoid causing them in the first place if that is convenient for you.""" +directory = DirectoryHasRepository() options = [] class Commit(object):
stgit/commands/branch.py +1 -0
@@ -40,6 +40,7 @@ When displaying the branches, the names can be prefixed with If not given any options, switch to the named branch.""" +directory = DirectoryHasRepository() options = [make_option('-c', '--create', help = 'create a new development branch', action = 'store_true'),
stgit/commands/clean.py +1 -0
@@ -31,6 +31,7 @@ Delete the empty patches in the whole series or only those applied or unapplied. A patch is considered empty if the two commit objects representing its boundaries refer to the same tree object.""" +directory = DirectoryHasRepository() options = [make_option('-a', '--applied', help = 'delete the empty applied patches', action = 'store_true'),
stgit/commands/clone.py +1 -0
@@ -29,6 +29,7 @@ usage = """%prog [options] <repository> <dir> Clone a GIT <repository> into the local <dir> and initialise the patch stack.""" +directory = DirectoryAnywhere() options = []
stgit/commands/commit.py +1 -0
@@ -32,6 +32,7 @@ remove them from the series while advancing the base. Use this command only if you want to permanently store the applied patches and no longer manage them with StGIT.""" +directory = DirectoryHasRepository() options = []
stgit/commands/common.py +68 -0
77 lines not on this page · raw message
stgit/commands/copy.py +1 -0
@@ -30,6 +30,7 @@ usage = """%prog [options] [<file/dir> <newname> | <files/dirs...> <dir>] Copy of the files and dirs passed as arguments under another name or location inside the same repository.""" +directory = DirectoryHasRepository() options = [] def func(parser, options, args):
stgit/commands/delete.py +1 -0
@@ -36,6 +36,7 @@ patches are deleted, they are popped from the stack. Note that the 'delete' operation is irreversible.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/commands/diff.py +1 -0
@@ -42,6 +42,7 @@ rev = '([patch][//[bottom | top]]) | <tree-ish> | base' If neither bottom nor top are given but a '//' is present, the command shows the specified patch (defaulting to the current one).""" +directory = DirectoryHasRepository() options = [make_option('-r', '--range', metavar = 'rev1[..[rev2]]', dest = 'revs', help = 'show the diff between revisions'),
stgit/commands/edit.py +1 -0
@@ -57,6 +57,7 @@ rejected patch is stored in the .stgit-failed.patch file (and also in these files using the '--file' and '--diff' options. """ +directory = DirectoryHasRepository() options = [make_option('-d', '--diff', help = 'edit the patch diff', action = 'store_true'),
stgit/commands/export.py +1 -0
@@ -49,6 +49,7 @@ file: %(commemail)s - committer's e-mail """ +directory = DirectoryHasRepository() options = [make_option('-d', '--dir', help = 'export patches to DIR instead of the default'), make_option('-p', '--patch',
stgit/commands/files.py +1 -0
@@ -34,6 +34,7 @@ given patch. Note that this command doesn't show the files modified in the working tree and not yet included in the patch by a 'refresh' command. Use the 'diff' or 'status' commands for these files.""" +directory = DirectoryHasRepository() options = [make_option('-s', '--stat', help = 'show the diff stat', action = 'store_true'),
stgit/commands/float.py +1 -0
@@ -31,6 +31,7 @@ necessary pop and push operations will be performed to accomplish this. The '--series' option can be used to rearrange the (top) patches as specified by the given series file (or the standard input).""" +directory = DirectoryHasRepository() options = [make_option('-s', '--series', help = 'rearrange according to a series file', action = 'store_true')]
stgit/commands/fold.py +1 -0
@@ -34,6 +34,7 @@ performed with the current top. With the --base option, the patch is applied onto the specified base and a three-way merged is performed with the current top.""" +directory = DirectoryHasRepository() options = [make_option('-t', '--threeway', help = 'perform a three-way merge with the current patch', action = 'store_true'),
stgit/commands/goto.py +1 -0
@@ -31,6 +31,7 @@ line becomes current. This is a shortcut for the 'push --to' or 'pop --to' commands. There is no '--undo' option for 'goto'. Use the 'push' command for this.""" +directory = DirectoryHasRepository() options = [make_option('-k', '--keep', help = 'keep the local changes when popping patches', action = 'store_true')]
stgit/commands/hide.py +1 -0
@@ -30,6 +30,7 @@ usage = """%prog [options] <patch-range> Hide a range of unapplied patches so that they are no longer shown in the plain 'series' command output.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/commands/id.py +1 -0
@@ -33,6 +33,7 @@ the standard GIT id's like heads and tags, this command also accepts 'top' or 'bottom' are passed and <patch> is a valid patch name, 'top' will be used by default.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/commands/imprt.py +1 -0
@@ -44,6 +44,7 @@ stack. The patch description has to be separated from the data with a '---' line.""" +directory = DirectoryHasRepository() options = [make_option('-m', '--mail', help = 'import the patch from a standard e-mail file', action = 'store_true'),
stgit/commands/init.py +1 -0
@@ -31,6 +31,7 @@ Initialise the current GIT branch to be used as an StGIT stack. Note that you must already be in a GIT repository and .git/HEAD must point to a valid file in refs/heads/.""" +directory = DirectoryHasRepository() options = []
stgit/commands/log.py +1 -0
@@ -43,6 +43,7 @@ represent the changes to the entire base of the current patch. Conflicts reset the patch content and a subsequent 'refresh' will show the entire patch.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one'), make_option('-p', '--patch',
stgit/commands/mail.py +1 -0
@@ -88,6 +88,7 @@ the following: %(prefix)s - 'prefix ' string passed on the command line %(shortdescr)s - the first line of the patch description""" +directory = DirectoryHasRepository() options = [make_option('-a', '--all', help = 'e-mail all the applied patches', action = 'store_true'),
stgit/commands/new.py +1 -0
@@ -38,6 +38,7 @@ needed for this. If no name is given for the new patch, one is generated from the first line of the commit message.""" +directory = DirectoryHasRepository() options = [make_option('-m', '--message', help = 'use MESSAGE as the patch description'), make_option('-s', '--showpatch',
stgit/commands/patches.py +1 -0
@@ -33,6 +33,7 @@ it shows the patches affected by the local tree modifications. The '--diff' option also lists the patch log and the diff for the given files.""" +directory = DirectoryHasRepository() options = [make_option('-d', '--diff', help = 'show the diff for the given files', action = 'store_true'),
stgit/commands/pick.py +1 -0
@@ -34,6 +34,7 @@ the name of the current patch. It can be overridden with the '--name' option. A commit object can be reverted with the '--reverse' option. The log and author information are those of the commit object.""" +directory = DirectoryHasRepository() options = [make_option('-n', '--name', help = 'use NAME as the patch name'), make_option('-r', '--reverse',
stgit/commands/pop.py +1 -0
@@ -36,6 +36,7 @@ patches passed on the command line are popped from the stack. Some of the push operations may fail because of conflicts (push --undo would revert the last push operation).""" +directory = DirectoryHasRepository() options = [make_option('-a', '--all', help = 'pop all the applied patches', action = 'store_true'),
stgit/commands/pull.py +1 -0
@@ -38,6 +38,7 @@ resolved and the patch pushed again. Check the 'git fetch' documentation for the <repository> format.""" +directory = DirectoryHasRepository() options = [make_option('-n', '--nopush', help = 'do not push the patches back after pulling', action = 'store_true'),
stgit/commands/push.py +1 -0
@@ -39,6 +39,7 @@ command run. The command also notifies when the patch becomes empty (fully merged upstream) or is modified (three-way merged) by the 'push' operation.""" +directory = DirectoryHasRepository() options = [make_option('-a', '--all', help = 'push all the unapplied patches', action = 'store_true'),
stgit/commands/rebase.py +1 -0
@@ -29,6 +29,7 @@ usage = """%prog [options] <new-base-id> Pop all patches from current stack, move the stack base to the given <new-base-id> and push the patches back.""" +directory = DirectoryHasRepository() options = [make_option('-n', '--nopush', help = 'do not push the patches back after rebasing', action = 'store_true'),
stgit/commands/refresh.py +1 -0
@@ -37,6 +37,7 @@ options. The '--force' option is useful when a commit object was created with a different tool but the changes need to be included in the current patch.""" +directory = DirectoryHasRepository() options = [make_option('-f', '--force', help = 'force the refresh even if HEAD and '\ 'top differ',
stgit/commands/rename.py +1 -0
@@ -29,6 +29,7 @@ usage = """%prog [options] <oldpatch> <newpatch> Rename <oldpatch> into <newpatch> in a series.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/commands/resolved.py +1 -0
@@ -34,6 +34,7 @@ Mark a merge conflict as resolved. The conflicts can be seen with the 'C'. This command also removes any <file>.{ancestor,current,patched} files.""" +directory = DirectoryHasRepository() options = [make_option('-a', '--all', help = 'mark all conflicts as solved', action = 'store_true'),
stgit/commands/rm.py +1 -0
@@ -30,6 +30,7 @@ usage = """%prog [options] <files...> Remove given files from the repository. The command doesn't remove the working copy of the file.""" +directory = DirectoryHasRepository() options = [make_option('-f', '--force', help = 'force removing even if the file exists', action = 'store_true')]
stgit/commands/series.py +1 -0
@@ -34,6 +34,7 @@ range. The applied patches are prefixed with a '+', the unapplied ones with a '-' and the hidden ones with a '!'. The current patch is prefixed with a '>'. Empty patches are prefixed with a '0'.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one'), make_option('-a', '--all',
stgit/commands/show.py +1 -0
@@ -30,6 +30,7 @@ Show the commit log and the diff corresponding to the given patches. The output is similar to that generated by the 'git show' command.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one'), make_option('-a', '--applied',
stgit/commands/sink.py +1 -0
@@ -32,6 +32,7 @@ push the specified <patches> (the current patch by default), and then push back into place the formerly-applied patches (unless -n is also given).""" +directory = DirectoryHasRepository() options = [make_option('-n', '--nopush', help = 'do not push the patches back after sinking', action = 'store_true'),
stgit/commands/status.py +1 -0
@@ -40,6 +40,7 @@ under revision control. The files are prefixed as follows: A 'refresh' command clears the status of the modified, new and deleted files.""" +directory = DirectoryHasRepository() options = [make_option('-m', '--modified', help = 'show modified files only', action = 'store_true'),
stgit/commands/sync.py +1 -0
@@ -36,6 +36,7 @@ in the series must apply cleanly. The sync operation can be reverted for individual patches with --undo.""" +directory = DirectoryHasRepository() options = [make_option('-a', '--all', help = 'synchronise all the patches', action = 'store_true'),
stgit/commands/top.py +1 -0
@@ -30,6 +30,7 @@ usage = """%prog [options] Print the name of the current (topmost) patch.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/commands/unapplied.py +1 -0
@@ -31,6 +31,7 @@ usage = """%prog [options] List the patches from the series which are not pushed onto the stack. They are listed in the reverse order in which they were popped.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one'), make_option('-c', '--count',
stgit/commands/uncommit.py +1 -0
@@ -48,6 +48,7 @@ given commit should be uncommitted. Only commits with exactly one parent can be uncommitted; in other words, you can't uncommit a merge.""" +directory = DirectoryHasRepository() options = [make_option('-n', '--number', type = 'int', help = 'uncommit the specified number of commits'), make_option('-t', '--to',
stgit/commands/unhide.py +1 -0
@@ -30,6 +30,7 @@ usage = """%prog [options] <patch-range> Unhide a hidden range of patches so that they are shown in the plain 'series' command output.""" +directory = DirectoryHasRepository() options = [make_option('-b', '--branch', help = 'use BRANCH instead of the default one')]
stgit/main.py +2 -0
@@ -252,6 +252,7 @@ def main(): usage = command.usage.split('\n')[0].strip() parser = OptionParser(usage = usage, option_list = command.options) options, args = parser.parse_args() + directory = command.directory # These modules are only used from this point onwards and do not # need to be imported earlier
@@ -267,6 +268,7 @@ def main(): sys.exit(1) try: + directory.setup() config_setup() # 'clone' doesn't expect an already initialised GIT tree. A Series
PATCH 2/5 New test: Try "stg push" in a subdirectory
In reply to Karl HasselströmThis currently fails for the non-fast-forward cases.
---
t/t1205-push-subdir.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) create mode 100755 t/t1205-push-subdir.sh
t/t1205-push-subdir.sh new file +55 -0
@@ -0,0 +1,55 @@ +#!/bin/sh +test_description='Test the push command from a subdirectory' +. ./test-lib.sh +stg init + +test_expect_success 'Create some patches' ' + mkdir foo + for i in 0 1 2; do + stg new p$i -m p$i && + echo x$i >> x.txt && + echo y$i >> foo/y.txt && + stg add x.txt foo/y.txt && + stg refresh + done && + [ "$(echo $(stg applied))" = "p0 p1 p2" ] && + [ "$(echo $(stg unapplied))" = "" ] +' + +test_expect_success 'Fast-forward push from a subdir' ' + stg pop && + [ "$(echo $(cat x.txt))" = "x0 x1" ] && + [ "$(echo $(cat foo/y.txt))" = "y0 y1" ] && + cd foo && + stg push && + cd .. && + [ "$(echo $(cat x.txt))" = "x0 x1 x2" ] && + [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] +' + +test_expect_failure 'Modifying push from a subdir' ' + stg pop && + [ "$(echo $(cat x.txt))" = "x0 x1" ] && + [ "$(echo $(cat foo/y.txt))" = "y0 y1" ] && + stg new extra -m extra && + echo extra >> extra.txt && + stg add extra.txt && + stg refresh && + cd foo && + stg push && + cd .. && + [ "$(echo $(cat x.txt))" = "x0 x1 x2" ] && + [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] +' + +test_expect_failure 'Conflicting push from subdir' ' + stg pop p1 p2 && + [ "$(echo $(cat x.txt))" = "x0" ] && + [ "$(echo $(cat foo/y.txt))" = "y0" ] && + cd foo && + ! stg push p2 && + cd .. && + [ "$(echo $(stg status --conflict))" = "foo/y.txt x.txt" ] +' + +test_done
PATCH 3/5 Make "stg push" subdirectory safe
In reply to Karl HasselströmMake "stg push" 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 push subroutine should instead be safe to run from a subdirectory. However, pushing from a subdirectory currently erases the parts of a patch that doesn't touch that subdirectory, and that has to be fixed.
---
stgit/commands/push.py | 2 +- t/t1205-push-subdir.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
stgit/commands/push.py +1 -1
@@ -39,7 +39,7 @@ command run. The command also notifies when the patch becomes empty (fully merged upstream) or is modified (three-way merged) by the 'push' operation.""" -directory = DirectoryHasRepository() +directory = DirectoryGotoToplevel() options = [make_option('-a', '--all', help = 'push all the unapplied patches', action = 'store_true'),
t/t1205-push-subdir.sh +2 -2
@@ -27,7 +27,7 @@ test_expect_success 'Fast-forward push from a subdir' ' [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] ' -test_expect_failure 'Modifying push from a subdir' ' +test_expect_success 'Modifying push from a subdir' ' stg pop && [ "$(echo $(cat x.txt))" = "x0 x1" ] && [ "$(echo $(cat foo/y.txt))" = "y0 y1" ] &&
@@ -42,7 +42,7 @@ test_expect_failure 'Modifying push from a subdir' ' [ "$(echo $(cat foo/y.txt))" = "y0 y1 y2" ] ' -test_expect_failure 'Conflicting push from subdir' ' +test_expect_success 'Conflicting push from subdir' ' stg pop p1 p2 && [ "$(echo $(cat x.txt))" = "x0" ] && [ "$(echo $(cat foo/y.txt))" = "y0" ] &&
PATCH 4/5 New test: try "stg refresh" in a subdirectory
In reply to Karl HasselströmCurrently, it doesn't work. Or rather, it does work for changes that are already in the index, which is the case for newly added files; but it doesn't work for changes that aren't in the index.
---
t/t2300-refresh-subdir.sh | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) create mode 100755 t/t2300-refresh-subdir.sh
t/t2300-refresh-subdir.sh new file +27 -0
@@ -0,0 +1,27 @@ +#!/bin/sh +test_description='Test the refresh command from a subdirectory' +. ./test-lib.sh +stg init + +test_expect_success 'Refresh from a subdirectory' ' + stg new foo -m foo && + echo foo >> foo.txt && + mkdir bar && + echo bar >> bar/bar.txt && + stg add foo.txt bar/bar.txt && + cd bar && + stg refresh && + cd .. && + [ "$(stg status)" = "" ] +' + +test_expect_failure 'Refresh again' ' + echo foo2 >> foo.txt && + echo bar2 >> bar/bar.txt && + cd bar && + stg refresh && + cd .. && + [ "$(stg status)" = "" ] +' + +test_done
PATCH 5/5 Make "stg refresh" subdirectory safe
In reply to Karl HasselströmMake "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.
---
stgit/commands/refresh.py | 2 +- t/t2300-refresh-subdir.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
stgit/commands/refresh.py +1 -1
@@ -37,7 +37,7 @@ options. The '--force' option is useful when a commit object was 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',
t/t2300-refresh-subdir.sh +1 -1
@@ -15,7 +15,7 @@ test_expect_success 'Refresh from a subdirectory' ' [ "$(stg status)" = "" ] ' -test_expect_failure 'Refresh again' ' +test_expect_success 'Refresh again' ' echo foo2 >> foo.txt && echo bar2 >> bar/bar.txt && cd bar &&