"this operation is only valid for push"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
The sequence of calls
remote.ls_remotes(...)
remote.fetch(...)
remote.push(...)
works, while
remote.ls_remotes(...)
remote.push(...)
doesn't, producing the GIT_ERROR_NET / "this operation is only valid for push" error.
I think this is because ls_remotes() explicitly calls connect(..., GIT_DIRECTION_FETCH), and fetch() implicitly calls disconnect() (within git_remote_fetch()). If fetch() is not called between ls_remotes() and push(), git_remote_push() encounters an existing connection with FETCH direction, and returns an error (from git_smart__get_push_stream()).
This could be addressed in several ways: either by disconnecting explicitly in ls_remotes(), or maybe by changing the implementation of connect_or_reset_options() and the functions it calls to handle the case where direction is changing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two call sequences using remote.ls_remotes(), remote.fetch(), and remote.push(), then inspect connect_or_reset_options() and the git_remote_push() path described in the issue. Done means pushing directly after ls_remotes() succeeds without the GIT_ERROR_NET error, with regression coverage for that sequence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100