driusan / dgit

A Pure Go Git Implementation
MIT License
112 stars 10 forks source link

Add send-pack command and refactor push #272

Closed driusan closed 4 years ago

driusan commented 4 years ago

This implements the git send-pack command and refactors "git push" to use the send-pack plumbing rather than the hack which was previously in place to allow pushing in the early days of dgit. The result should be that it will work with all transport protocols that are supported, and not just HTTP.

It also splits the push command into the same git/cmd package distinction for parsing command line and implementing the logic as other commands use instead of all being done in cmd. (Another leftover from the fact that push was one of the earliest things implemented in dgit.) In doing so, it brings the behavior of push closer in line with that of the official git client. (ie now the remote name is required, not the branch name, it can be called with no arguments, and --force is no longer implied.)

Also fixes a bug where Linux wasn't loading SSH keys because of incorrect build tags.