diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-23 06:51:34 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-13 09:46:36 +0200 |
commit | 7725499072aaf4d9093c615fee5a65d8477100bc (patch) | |
tree | fc68cffcafe2d9e762729334dfe2f7a4ee15783e /tests/online/clone.c | |
parent | 3fec548a989b09fc7a2c30f42b1d4fa123a8867e (diff) | |
download | libgit2-7725499072aaf4d9093c615fee5a65d8477100bc.tar.gz |
remote: remove live changing of refspecs
The base refspecs changing can be a cause of confusion as to what is the
current base refspec set and complicate saving the remote's
configuration.
Change `git_remote_add_{fetch,push}()` to update the configuration
instead of an instance.
This finally makes `git_remote_save()` a no-op, it will be removed in a
later commit.
Diffstat (limited to 'tests/online/clone.c')
-rw-r--r-- | tests/online/clone.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/online/clone.c b/tests/online/clone.c index 1d4196948..1930a8ba3 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -134,16 +134,9 @@ static int remote_mirror_cb(git_remote **out, git_repository *repo, GIT_UNUSED(payload); - if ((error = git_remote_create(&remote, repo, name, url)) < 0) + if ((error = git_remote_create_with_fetchspec(&remote, repo, name, url, "+refs/*:refs/*")) < 0) return error; - git_remote_clear_refspecs(remote); - - if ((error = git_remote_add_fetch(remote, "+refs/*:refs/*")) < 0) { - git_remote_free(remote); - return error; - } - *out = remote; return 0; } |