diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-10-24 18:25:59 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-10-24 18:25:59 +0400 |
commit | 46c8f7f8459e7062ca04d1cb8e11cf84e5cfbd0f (patch) | |
tree | 990d602b46e956b460ca9819d025dc0dfda27024 /include | |
parent | 4bb6ffb6bb8ad9d49eb173350be965183cd09c96 (diff) |
remote: accept a repo and name for renaming
Remote objects are not meant to be changed from under the user. We did
this in rename, but only the name and left the refspecs, such that a
save would save the wrong refspecs (and a fetch and anything else would
use the wrong refspecs).
Instead, let's simply take a name and not change any loaded remote from
under the user.
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/remote.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 977e9b809..600b8ef05 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -557,18 +557,21 @@ GIT_EXTERN(void) git_remote_set_autotag( * The new name will be checked for validity. * See `git_tag_create()` for rules about valid names. * - * A temporary in-memory remote cannot be given a name with this method. + * No loaded instances of a the remote with the old name will change + * their name or their list of refspecs. * * @param problems non-default refspecs cannot be renamed and will be * stored here for further processing by the caller. Always free this * strarray on succesful return. - * @param remote the remote to rename + * @param repo the repository in which to rename + * @param name the current name of the reamote * @param new_name the new name the remote should bear * @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code */ GIT_EXTERN(int) git_remote_rename( git_strarray *problems, - git_remote *remote, + git_repository *repo, + const char *name, const char *new_name); /** |