summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-12-21 08:05:59 -0800
committerBen Straub <bs@github.com>2012-12-21 08:05:59 -0800
commit79000951ec907c967a1c322da8c351998676f753 (patch)
tree35fac0fcd93f4ccf876d48eb34957ae8ee0b2b3c /src/remote.c
parent87bc689fbf571aa3cbc77e510f14304cc3502ca5 (diff)
downloadlibgit2-79000951ec907c967a1c322da8c351998676f753.tar.gz
In-memory remotes don't have names
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/remote.c b/src/remote.c
index f591af890..4d4614eb2 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -162,12 +162,12 @@ on_error:
return -1;
}
-int git_remote_create_inmemory(git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch)
+int git_remote_create_inmemory(git_remote **out, git_repository *repo, const char *url, const char *fetch)
{
int error;
git_remote *remote;
- if ((error = create_internal(&remote, repo, name, url, fetch)) < 0)
+ if ((error = create_internal(&remote, repo, NULL, url, fetch)) < 0)
return error;
remote->inmem = true;
@@ -1326,6 +1326,11 @@ int git_remote_rename(
assert(remote && new_name);
+ if (remote->inmem) {
+ giterr_set(GITERR_INVALID, "Can't rename an in-memory remote.");
+ return GIT_EINVALIDSPEC;
+ }
+
if ((error = ensure_remote_name_is_valid(new_name)) < 0)
return error;