Пример #1
0
def test_no_annex(path):
    ds = create(path)
    ok_clean_git(ds.path)
    create_tree(ds.path,
                {'code': {
                    'inannex': 'content',
                    'notinannex': 'othercontent'
                }})
    # add two files, pre and post configuration
    ds.add(opj('code', 'inannex'))
    no_annex(pattern='code/**', dataset=ds)
    ds.add(opj('code', 'notinannex'))
    ok_clean_git(ds.path)
    # one is annex'ed, the other is not, despite no change in add call
    # importantly, also .gitattribute is not annexed
    eq_([opj('code', 'inannex')], ds.repo.get_annexed_files())
Пример #2
0
def test_no_annex(path):
    ds = create(path)
    ok_clean_git(ds.path)
    create_tree(
        ds.path,
        {'code': {
            'inannex': 'content',
            'notinannex': 'othercontent'},
         'README': 'please'})
    # add inannex pre configuration
    ds.save(opj('code', 'inannex'))
    no_annex(pattern=['code/**', 'README'], dataset=ds)
    # add inannex and README post configuration
    ds.save([opj('code', 'notinannex'), 'README'])
    ok_clean_git(ds.path)
    # one is annex'ed, the other is not, despite no change in add call
    # importantly, also .gitattribute is not annexed
    eq_([opj('code', 'inannex')],
        ds.repo.get_annexed_files())
Пример #3
0
def test_no_annex(path):
    ds = create(path)
    assert_repo_status(ds.path)
    create_tree(
        ds.path,
        {'code': {
            'inannex': 'content',
            'notinannex': 'othercontent'},
         'README': 'please'})
    # add inannex pre configuration
    ds.save(opj('code', 'inannex'))
    no_annex(pattern=['code/**', 'README'], dataset=ds.path)
    # add inannex and README post configuration
    ds.save([opj('code', 'notinannex'), 'README'])
    assert_repo_status(ds.path)
    # one is annex'ed, the other is not, despite no change in add call
    # importantly, also .gitattribute is not annexed
    eq_([opj('code', 'inannex')],
        ds.repo.get_annexed_files())
Пример #4
0
def test_no_annex(path=None):
    ds = create(path)
    assert_repo_status(ds.path)
    create_tree(
        ds.path, {
            'code': {
                'inannex': 'content',
                'notinannex': 'othercontent'
            },
            'README': 'please'
        })
    # add inannex pre configuration
    ds.save(opj('code', 'inannex'))
    no_annex(pattern=['code/**', 'README'], dataset=ds.path)

    inannex = (ds.pathobj / 'code' / 'inannex')

    # add inannex and README post configuration
    ds.save([opj('code', 'notinannex'), 'README'])

    repo = ds.repo
    try:
        assert_repo_status(ds.path)
    except AssertionError:
        # If on an adjusted branch and notinannex's mtime is as recent or newer
        # than .git/index's, the clean filter runs on it when save() is called.
        # This leads to a racy failure until after git-annex's 424bef6b6
        # (smudge: check for known annexed inodes before checking
        # annex.largefiles, 2021-05-03).
        #
        # https://git-annex.branchable.com/forum/one-off_unlocked_annex_files_that_go_against_large/
        if repo.is_managed_branch() and repo.git_annex_version <= "8.20210428":
            assert_repo_status(ds.path, modified=[inannex])
            raise SkipTest("Known bug fixed in git-annex")
        raise

    # one is annex'ed, the other is not, despite no change in add call
    # importantly, also .gitattribute is not annexed
    eq_([opj('code', 'inannex')],
        [str(Path(p)) for p in repo.get_annexed_files()])