Skip to content
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