mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
filter-repo: include additional worktrees in sanity startup check
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
aa63db17bc
commit
89e5c43805
@ -2779,6 +2779,11 @@ class RepoFilter(object):
|
|||||||
abort(_('%s does not match %s') % (decode(refname),
|
abort(_('%s does not match %s') % (decode(refname),
|
||||||
decode(origin_ref)))
|
decode(origin_ref)))
|
||||||
|
|
||||||
|
# Make sure there is only one worktree
|
||||||
|
output = subprocess.check_output('git worktree list'.split())
|
||||||
|
if len(output.splitlines()) > 1:
|
||||||
|
abort(_('you have multiple worktrees'))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def tweak_blob(args, blob):
|
def tweak_blob(args, blob):
|
||||||
if args.replace_text:
|
if args.replace_text:
|
||||||
|
@ -703,6 +703,12 @@ test_expect_success 'startup sanity checks' '
|
|||||||
test_i18ngrep "you have untracked changes" err &&
|
test_i18ngrep "you have untracked changes" err &&
|
||||||
rm err &&
|
rm err &&
|
||||||
|
|
||||||
|
git worktree add ../other-worktree HEAD &&
|
||||||
|
test_must_fail git filter-repo --path numbers 2>../err &&
|
||||||
|
test_i18ngrep "you have multiple worktrees" ../err &&
|
||||||
|
rm -rf ../err &&
|
||||||
|
git worktree remove ../other-worktree &&
|
||||||
|
|
||||||
git update-ref -d refs/remotes/origin/master &&
|
git update-ref -d refs/remotes/origin/master &&
|
||||||
test_must_fail git filter-repo --path numbers 2>../err &&
|
test_must_fail git filter-repo --path numbers 2>../err &&
|
||||||
test_i18ngrep "refs/heads/master exists, but refs/remotes/origin/master not found" ../err &&
|
test_i18ngrep "refs/heads/master exists, but refs/remotes/origin/master not found" ../err &&
|
||||||
|
Loading…
Reference in New Issue
Block a user