Skip to content

The remote directory isn't correctly added #2

@gcetusic

Description

@gcetusic

Let's say we have a remote repository https://github.com/user/repo.git and it wasn't added to local git remote list. The following code should create the repository if 'git ls-remote' fails

try:
    subprocess.check_call(['git', 'ls-remote', git_repository])
except subprocess.CalledProcessError:
    try:
        subprocess.check_call(['git', 'remote', 'add', 'po_translator', git_repository])
    except subprocess.CalledProcessError as e:
        raise PODocsError(e)

Bit if the public key is set correctly, running 'git ls-remote git@github.com:user/repo.git' doesn't cause an exception and, later, the code fails because the repo po_translator doesn't exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions