libgit2 / libgit2/pygit2

Unable to ssh push in pygit2

Open
#1,174 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

self = <pygit2.remote.Remote object at 0x10acc76a0>, specs = ['refs/heads/git-push-test-ssh'], callbacks = <class 'fixtures.repos.fixture_cli.MyRemoteCallbacks'>
proxy = None

def push(self, specs, callbacks=None, proxy=None):
    """
    Push the given refspec to the remote. Raises ``GitError`` on protocol
    error or unpack failure.

    When the remote has a githook installed, that denies the reference this
    function will return successfully. Thus it is strongly recommended to
    install a callback, that implements
    :py:meth:`RemoteCallbacks.push_update_reference` and check the passed
    parameters for successfull operations.

    Parameters:

    specs : [str]
        Push refspecs to use.

    proxy : None or True or str
        Proxy configuration. Can be one of:

        * `None` (the default) to disable proxy usage
        * `True` to enable automatic proxy detection
        * an url to a proxy (`http://proxy.example.org:3128/`)
    """
    with git_push_options(callbacks) as payload:
        opts = payload.push_options
        self.__set_proxy(opts.proxy_opts, proxy)
        with StrArray(specs) as refspecs:
            err = C.git_remote_push(self._remote, refspecs, opts)
          payload.check_error(err)

E TypeError: check_error() missing 1 required positional argument: 'error_code'

.venv/lib/python3.9/site-packages/pygit2/remote.py:257: TypeError

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The traceback points to pygit2/remote.py in Remote.push, where payload.check_error(err) is called. Reproduce the SSH push failure and inspect the check_error signature and surrounding push flow; done means the SSH push no longer raises this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.