~edwargix/git.sr.ht

e49beb06b4f471317631d00fb1e1db062a728996 — Drew DeVault 4 years ago 5fedffd
Further robustness improvements to 3c1285bb23e2
1 files changed, 4 insertions(+), 4 deletions(-)

M gitsrht/alembic/versions/3c1285bb23e2_allow_deleting_default_branch.py
M gitsrht/alembic/versions/3c1285bb23e2_allow_deleting_default_branch.py => gitsrht/alembic/versions/3c1285bb23e2_allow_deleting_default_branch.py +4 -4
@@ 28,13 28,13 @@ def upgrade():
    session = Session(bind=bind)
    print("Setting receive.denyDeleteCurrent=ignore")
    for repo in tqdm(session.query(Repository).all()):
        subprocess.run(["git", "config", "receive.denyDeleteCurrent", "ignore"],
            cwd=repo.path, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        subprocess.run(["git", "-C", repo.path, "config", "receive.denyDeleteCurrent", "ignore"],
            stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)


def downgrade():
    bind = op.get_bind()
    session = Session(bind=bind)
    for repo in tqdm(session.query(Repository).all()):
        subprocess.run(["git", "config", "--unset", "receive.denyDeleteCurrent"],
            cwd=repo.path, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        subprocess.run(["git", "-C", repo.path, "config", "--unset", "receive.denyDeleteCurrent"],
            stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)