Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-09-21 00:57:01 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-02 08:42:26 +0400
commitc833893c64d28d4c017fdbf90bbeb714314a8dd9 (patch)
treea3a8535a34dbc33ffc014aae71cdbdb27074dd08 /src/clone.c
parenteec1c1fe1e9a12b57c4014be25ce4ed390c8e199 (diff)
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)