Kill vestigal dangling-remote code Fixes #1232
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/include/git2/remote.h b/include/git2/remote.h
index a0f5d52..b92a0cd 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -60,7 +60,7 @@ GIT_EXTERN(int) git_remote_create(
* See `git_tag_create()` for rules about valid names.
*
* @param out pointer to the new remote object
- * @param repo the associated repository. May be NULL for a "dangling" remote.
+ * @param repo the associated repository
* @param fetch the fetch refspec to use for this remote. May be NULL for defaults.
* @param url the remote repository's URL
* @return 0 or an error code
@@ -72,16 +72,6 @@ GIT_EXTERN(int) git_remote_create_inmemory(
const char *url);
/**
- * Sets the owning repository for the remote. This is only allowed on
- * dangling remotes.
- *
- * @param remote the remote to configure
- * @param repo the repository that will own the remote
- * @return 0 or an error code
- */
-GIT_EXTERN(int) git_remote_set_repository(git_remote *remote, git_repository *repo);
-
-/**
* Get the information for a particular remote
*
* The name will be checked for validity.
diff --git a/src/remote.c b/src/remote.c
index dbfad13..d7e1c5f 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -195,19 +195,6 @@ int git_remote_create_inmemory(git_remote **out, git_repository *repo, const cha
return 0;
}
-int git_remote_set_repository(git_remote *remote, git_repository *repo)
-{
- assert(repo);
-
- if (remote->repo) {
- giterr_set(GITERR_INVALID, "Remotes can't change repositiories.");
- return GIT_ERROR;
- }
-
- remote->repo = repo;
- return 0;
-}
-
int git_remote_load(git_remote **out, git_repository *repo, const char *name)
{
git_remote *remote;