Skip to content

Commit

Permalink
Delete a ref for origin/gh-pages when deploying
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
hroncok committed Feb 28, 2017
1 parent d0f0b5b commit 51b8954
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions elsa/_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def deploy(html_dir, *, push):

print('Rewriting gh-pages branch...')
run(['git', 'branch', '-D', 'gh-pages'], check=False, quiet=True)
ref = '.git/refs/remotes/origin/gh-pages'
if os.path.exists(ref):
os.remove(ref)
commit_message = 'Deploying {}'.format(random.choice(COMMIT_EMOJIS))
run([
'ghp-import',
Expand Down
2 changes: 0 additions & 2 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ def test_deploy_git(elsa, cname, push, gitrepo):


def test_deploy_twice_only_one_commit(elsa, push, gitrepo):
if is_true(push):
pytest.xfail('https://github.com/pyvec/elsa/issues/14')
elsa.run('deploy', push)
elsa.run('deploy', push)
assert len(commits()) == 1
Expand Down

0 comments on commit 51b8954

Please sign in to comment.