// Figure out whether it's a named remote or a URL
printf("Fetching %s for repo %p\n", argv[1], repo);
if (git_remote_load(&remote, repo, argv[1]) < 0) {
- if (git_remote_create_inmemory(&remote, repo, argv[1], NULL) < 0)
+ if (git_remote_create_inmemory(&remote, repo, NULL, argv[1]) < 0)
return -1;
}
// Create an instance of a remote from the URL. The transport to use
// is detected from the URL
- error = git_remote_create_inmemory(&remote, repo, url, NULL);
+ error = git_remote_create_inmemory(&remote, repo, NULL, url);
if (error < 0)
goto cleanup;
*
* @param out pointer to the new remote object
* @param repo the associated repository. May be NULL for a "dangling" remote.
- * @param url the remote repository's URL
* @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
*/
GIT_EXTERN(int) git_remote_create_inmemory(
git_remote **out,
git_repository *repo,
- const char *url,
- const char *fetch);
+ const char *fetch,
+ const char *url);
/**
* Sets the owning repository for the remote. This is only allowed on
return -1;
}
-int git_remote_create_inmemory(git_remote **out, git_repository *repo, const char *url, const char *fetch)
+int git_remote_create_inmemory(git_remote **out, git_repository *repo, const char *fetch, const char *url)
{
int error;
git_remote *remote;
{
git_buf_sets(&file_path_buf, cl_git_path_url(local_repository));
- cl_git_pass(git_remote_create_inmemory(&remote, repo, git_buf_cstr(&file_path_buf), NULL));
+ cl_git_pass(git_remote_create_inmemory(&remote, repo, NULL, git_buf_cstr(&file_path_buf)));
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH));
}
{
git_remote *remote;
- cl_git_pass(git_remote_create_inmemory(&remote, _repo, "file:///blah", NULL));
+ cl_git_pass(git_remote_create_inmemory(&remote, _repo, NULL, "file:///blah"));
cl_git_fail(git_remote_rename(remote, "newname", NULL, NULL));
git_remote_free(remote);
{
git_remote *remote;
- cl_git_pass(git_remote_create_inmemory(&remote, _repo, "git://github.com/libgit2/libgit2", NULL));
+ cl_git_pass(git_remote_create_inmemory(&remote, _repo, NULL, "git://github.com/libgit2/libgit2"));
cl_assert_equal_p(NULL, git_remote_name(remote));
git_remote_free(_remote);
_remote = NULL;
- cl_git_pass(git_remote_create_inmemory(&_remote, _repo, "test-protocol://localhost", NULL));
+ cl_git_pass(git_remote_create_inmemory(&_remote, _repo, NULL, "test-protocol://localhost"));
transport.version = 0;
cl_git_fail(git_remote_set_transport(_remote, &transport));