File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,26 @@ public virtual string UpstreamBranchCanonicalName
153
153
}
154
154
}
155
155
156
+ /// <summary>
157
+ /// Get the name of the remote for the branch.
158
+ /// <para>
159
+ /// If this is a local branch, this will return the configured
160
+ /// <see cref="Remote"/> to fetch from and push to. If this is a
161
+ /// remote-tracking branch, this will return the name of the remote
162
+ /// containing the tracked branch. If there no tracking information
163
+ /// this will return null.
164
+ /// </para>
165
+ /// </summary>
166
+ public virtual string RemoteName
167
+ {
168
+ get
169
+ {
170
+ return IsRemote
171
+ ? RemoteNameFromRemoteTrackingBranch ( )
172
+ : RemoteNameFromLocalBranch ( ) ;
173
+ }
174
+ }
175
+
156
176
/// <summary>
157
177
/// Get the remote for the branch.
158
178
/// <para>
@@ -162,20 +182,12 @@ public virtual string UpstreamBranchCanonicalName
162
182
/// the tracked branch.
163
183
/// </para>
164
184
/// </summary>
185
+ [ Obsolete ( "This property is deprecated. Use Repository.Network.Remotes[] using the RemoteName property" ) ]
165
186
public virtual Remote Remote
166
187
{
167
188
get
168
189
{
169
- string remoteName ;
170
-
171
- if ( IsRemote )
172
- {
173
- remoteName = RemoteNameFromRemoteTrackingBranch ( ) ;
174
- }
175
- else
176
- {
177
- remoteName = RemoteNameFromLocalBranch ( ) ;
178
- }
190
+ string remoteName = RemoteName ;
179
191
180
192
if ( remoteName == null )
181
193
{
You can’t perform that action at this time.
0 commit comments