Skip to content

Detached remotes - #4233

Merged
ethomson merged 5 commits into
libgit2:masterfrom
pks-t:pks/expat-remotes
Jul 30, 2017
Merged

ethomson merged 5 commits into
libgit2:masterfrom
pks-t:pks/expat-remotes

Conversation

@pks-t

@pks-t pks-t commented May 5, 2017

Copy link
Copy Markdown
Member

Took over from #3855. This includes the original contents from @heavenlyhash squashed together and rebased on master. While at it, I renamed git_remote_create_unattached to the more common git_remote_create_detached. I added checks to refuse push/download/upload for detached repositories, as it would segfault otherwise. I also added a few tests for git_remote_ls with detached remotes and tests checking whether we correctly refuse the other actions.

pks-t and others added 5 commits May 5, 2017 10:40
The current error message when connecting to a remote when no URL is set
is missing information on whether it is missing a fetch or push URL.
Furthermore, it results in undefined behavior when using a remote
without name. Fix both issues.
There are only few actions which actually make sense for a detached
remote, like e.g. `git_remote_ls`, `git_remote_prune`. For all the other
actions, we have to report an error when the remote has no repository
attached to it. This commit does so and implements some tests.
Right now it is only possible to create remotes from a repository. While
this is probably the most common use-case, there are commands which make
sense even without a repository, e.g. the equivalence of `git
ls-remote`. Add a new function `git_remote_create_detached`, which
simply accepts a URL.
The repository URL is duplicated several times and can be de-duplicated
like this. Furthermore, exchange the static refspec variable with a
define to reduce BSS size.
@ethomson
ethomson merged commit 9364f27 into libgit2:master Jul 30, 2017
@ethomson

Copy link
Copy Markdown
Member

I updated the changelog to reflect the change in API name, and I manually merged this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants