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

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJameson Miller <jamill@microsoft.com>2012-10-17 00:34:00 +0400
committernulltoken <emeric.fermas@gmail.com>2012-10-17 12:16:57 +0400
commit93ef4790ac966c673dd760fb318ce9505071c9cc (patch)
treeb9f09184b186238c5f2df1926c8034a1a85cab83 /LibGit2Sharp/RemoteCollection.cs
parentbe2be63d106e00cbbe392600b5ff56a29cd960d9 (diff)
Add ability to fetch from remotes.
Diffstat (limited to 'LibGit2Sharp/RemoteCollection.cs')
-rw-r--r--LibGit2Sharp/RemoteCollection.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/LibGit2Sharp/RemoteCollection.cs b/LibGit2Sharp/RemoteCollection.cs
index 4e1cd306..523c63c4 100644
--- a/LibGit2Sharp/RemoteCollection.cs
+++ b/LibGit2Sharp/RemoteCollection.cs
@@ -32,14 +32,14 @@ namespace LibGit2Sharp
/// <returns>The retrived <see cref = "Remote" /> if it has been found, null otherwise.</returns>
public virtual Remote this[string name]
{
- get { return RemoteForName(name); }
+ get { return RemoteForName(name, false); }
}
- private Remote RemoteForName(string name)
+ internal Remote RemoteForName(string name, bool shouldThrowIfNotFound = true)
{
- using (RemoteSafeHandle handle = Proxy.git_remote_load(repository.Handle, name, false))
+ using (RemoteSafeHandle handle = Proxy.git_remote_load(repository.Handle, name, shouldThrowIfNotFound))
{
- return handle == null ? null : Remote.BuildFromPtr(handle);
+ return handle == null ? null : Remote.BuildFromPtr(handle, this.repository);
}
}
@@ -80,7 +80,7 @@ namespace LibGit2Sharp
using (RemoteSafeHandle handle = Proxy.git_remote_add(repository.Handle, name, url))
{
- return Remote.BuildFromPtr(handle);
+ return Remote.BuildFromPtr(handle, this.repository);
}
}
@@ -115,7 +115,7 @@ namespace LibGit2Sharp
using (RemoteSafeHandle handle = Proxy.git_remote_new(repository.Handle, name, url, fetchRefSpec))
{
Proxy.git_remote_save(handle);
- return Remote.BuildFromPtr(handle);
+ return Remote.BuildFromPtr(handle, this.repository);
}
}