summaryrefslogtreecommitdiff
path: root/src/clone.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-09-20 22:57:01 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-02 06:42:26 +0200
commitc833893c64d28d4c017fdbf90bbeb714314a8dd9 (patch)
treea3a8535a34dbc33ffc014aae71cdbdb27074dd08 /src/clone.c
parenteec1c1fe1e9a12b57c4014be25ce4ed390c8e199 (diff)
downloadlibgit2-c833893c64d28d4c017fdbf90bbeb714314a8dd9.tar.gz
clone: re-allow using a custom remote name
This is a small thing that by itself doesn't quite justify making the user use clone_into.
Diffstat (limited to 'src/clone.c')
-rw-r--r--src/clone.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/clone.c b/src/clone.c
index 60525939f..cad9ea1dc 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -306,8 +306,10 @@ static int create_and_configure_origin(
{
int error;
git_remote *origin = NULL;
+ const char *name;
- if ((error = git_remote_create(&origin, repo, "origin", url)) < 0)
+ name = options->remote_name ? options->remote_name : "origin";
+ if ((error = git_remote_create(&origin, repo, name, url)) < 0)
goto on_error;
if (options->ignore_cert_errors)