Skip to content

Returning non-zero from push_negotiation callback causes git_remote_push to fail with missing config errors #6672

@freshstrangemusic

Description

@freshstrangemusic

Reproduction steps

  1. Create a repository
  2. Create a push_options object with a push_negotiation member that returns -1
  3. Call git_remote_push with any refspec

See the MWE https://gist.github.com/brennie/72afc8e0d61a490023392e6b31608540

Expected behavior

Not sure. At the very least, the errors about missing config values should be cleared. Perhaps the error set from inside the callback should be cached (if git_error_set was called) and restored.

Actual behavior

git_error_last() will report errors about missing configuration option pack.windowMemory. The error is set in packbuilder_config in pack-objects.c.

Version of libgit2 (release number or SHA1)

v1.7.1, v1.6.4

Operating system(s) tested

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions