def outdate_local(tmpdir, local_light, remote):
"""Clone remote to other directory and push changes. Causes `local` fixture to be outdated.
:param tmpdir: pytest fixture.
:param local_light: local fixture.
:param remote: local fixture.
:return: Path to repo root.
:rtype: py.path.local
"""
assert local_light # Ensures local_light is setup before this fixture pushes to remote.
local_ahead = tmpdir.ensure_dir('local_ahead')
run(local_ahead, ['git', 'clone', remote, '.'])
run(local_ahead, ['git', 'checkout', '-b', 'un_pushed_branch'])
local_ahead.join('README').write('changed')
run(local_ahead, ['git', 'commit', '-am', 'Changed new branch'], environ=author_committer_dates(1))
run(local_ahead, ['git', 'tag', 'nb_tag'])
run(local_ahead, ['git', 'checkout', '--orphan', 'orphaned_branch'])
local_ahead.join('README').write('new')
run(local_ahead, ['git', 'add', 'README'])
run(local_ahead, ['git', 'commit', '-m', 'Added new README'], environ=author_committer_dates(2))
run(local_ahead, ['git', 'tag', '--annotate', '-m', 'Tag annotation.', 'ob_at'])
run(local_ahead, ['git', 'push', 'origin', 'nb_tag', 'orphaned_branch', 'ob_at'])
return local_ahead
评论列表
文章目录