Skip to content

Don't load the remote's data eagerly #1295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions LibGit2Sharp/Remote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ internal Remote(RemoteHandle handle, Repository repository)
{
this.repository = repository;
this.handle = handle;
Name = Proxy.git_remote_name(handle);
Url = Proxy.git_remote_url(handle);
PushUrl = Proxy.git_remote_pushurl(handle);
TagFetchMode = Proxy.git_remote_autotag(handle);
refSpecs = new RefSpecCollection(this, handle);
repository.RegisterForCleanup(this);
}
Expand Down Expand Up @@ -75,27 +71,34 @@ void Dispose(bool disposing)
/// <summary>
/// Gets the alias of this remote repository.
/// </summary>
public virtual string Name { get; private set; }
public virtual string Name
{
get { return Proxy.git_remote_name(handle); }
}

/// <summary>
/// Gets the url to use to communicate with this remote repository.
/// </summary>
public virtual string Url { get; private set; }
public virtual string Url
{
get { return Proxy.git_remote_url(handle); } }

/// <summary>
/// Gets the distinct push url for this remote repository, if set.
/// Defaults to the fetch url (<see cref="Url"/>) if not set.
/// </summary>
public virtual string PushUrl
{
get { return pushUrl ?? Url; }
private set { pushUrl = value; }
get { return Proxy.git_remote_pushurl(handle) ?? Url; }
}

/// <summary>
/// Gets the Tag Fetch Mode of the remote - indicating how tags are fetched.
/// </summary>
public virtual TagFetchMode TagFetchMode { get; private set; }
public virtual TagFetchMode TagFetchMode
{
get { return Proxy.git_remote_autotag(handle); }
}

/// <summary>
/// Gets the list of <see cref="RefSpec"/>s defined for this <see cref="Remote"/>
Expand Down