Skip to content

Commit 88cf0d9

Browse files
yorahnulltoken
authored andcommitted
Remove obsolete methods
1 parent 02638bb commit 88cf0d9

17 files changed

+38
-289
lines changed

LibGit2Sharp/BranchUpdater.cs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,6 @@ internal BranchUpdater(Repository repo, Branch branch)
2828
this.branch = branch;
2929
}
3030

31-
/// <summary>
32-
/// Sets the upstream information for the branch.
33-
/// <para>
34-
/// Passing null or string.Empty will unset the upstream.
35-
/// </para>
36-
/// <para>
37-
/// The upstream branch name is with respect to the current repository.
38-
/// So, passing "refs/remotes/origin/master" will set the current branch
39-
/// to track "refs/heads/master" on the origin. Passing in
40-
/// "refs/heads/master" will result in the branch tracking the local
41-
/// master branch.
42-
/// </para>
43-
/// </summary>
44-
[Obsolete("This property will be removed in the next release. Please use BranchUpdate.TrackedBranch instead.")]
45-
public virtual string Upstream
46-
{
47-
set { TrackedBranch = value; }
48-
}
49-
5031
/// <summary>
5132
/// Sets the upstream information for the branch.
5233
/// <para>
@@ -74,20 +55,6 @@ public virtual string TrackedBranch
7455
}
7556
}
7657

77-
/// <summary>
78-
/// Set the upstream merge branch directly for this branch.
79-
/// <para>
80-
/// To track the "master" branch on the "origin" remote, set the
81-
/// <see cref="Remote"/> property to "origin" and the <see cref="UpstreamBranch"/>
82-
/// property to "refs/heads/master".
83-
/// </para>
84-
/// </summary>
85-
[Obsolete("This property will be removed in the next release. Please use BranchUpdate.UpstreamBranch instead.")]
86-
public virtual string UpstreamMergeBranch
87-
{
88-
set { UpstreamBranch = value; }
89-
}
90-
9158
/// <summary>
9259
/// Set the upstream branch for this branch.
9360
/// <para>
@@ -104,20 +71,6 @@ public virtual string UpstreamBranch
10471
}
10572
}
10673

107-
/// <summary>
108-
/// Set the upstream merge branch directly for this branch.
109-
/// <para>
110-
/// To track the "master" branch on the "origin" remote, set the
111-
/// RemoteName property to "origin" and the UpstreamMergeBranch
112-
/// property to "refs/heads/master".
113-
/// </para>
114-
/// </summary>
115-
[Obsolete("This property will be removed in the next release. Please use BranchUpdate.Remote instead.")]
116-
public virtual string UpstreamRemote
117-
{
118-
set { Remote = value; }
119-
}
120-
12174
/// <summary>
12275
/// Set the upstream remote for this branch.
12376
/// <para>

LibGit2Sharp/CommitLog.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private ObjectId DereferenceToCommit(string identifier)
248248
}
249249

250250
// TODO: Should we check the type? Git-log allows TagAnnotation oid as parameter. But what about Blobs and Trees?
251-
GitObject commit = repo.Lookup(identifier, Core.GitObjectType.Any, options);
251+
GitObject commit = repo.Lookup(identifier, GitObjectType.Any, options);
252252

253253
return commit != null ? commit.Id : null;
254254
}

LibGit2Sharp/Core/GitObjectType.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,5 @@ public static ObjectType ToObjectType(this GitObjectType type)
9898
throw new InvalidOperationException(string.Format("Cannot map {0} to a ObjectType.", type));
9999
}
100100
}
101-
102-
public static LibGit2Sharp.GitObjectType ToGitObjectType(this GitObjectType type)
103-
{
104-
return (LibGit2Sharp.GitObjectType)type;
105-
}
106101
}
107102
}

LibGit2Sharp/GitObject.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ public virtual string Sha
6060
get { return Id.Sha; }
6161
}
6262

63-
internal static GitObject BuildFrom(Repository repo, ObjectId id, Core.GitObjectType type, FilePath path)
63+
internal static GitObject BuildFrom(Repository repo, ObjectId id, GitObjectType type, FilePath path)
6464
{
6565
switch (type)
6666
{
67-
case Core.GitObjectType.Commit:
67+
case GitObjectType.Commit:
6868
return new Commit(repo, id);
69-
case Core.GitObjectType.Tree:
69+
case GitObjectType.Tree:
7070
return new Tree(repo, id, path);
71-
case Core.GitObjectType.Tag:
71+
case GitObjectType.Tag:
7272
return new TagAnnotation(repo, id);
73-
case Core.GitObjectType.Blob:
73+
case GitObjectType.Blob:
7474
return new Blob(repo, id);
7575
default:
7676
throw new LibGit2SharpException(string.Format(CultureInfo.InvariantCulture, "Unexpected type '{0}' for object '{1}'.", type, id));
@@ -79,14 +79,14 @@ internal static GitObject BuildFrom(Repository repo, ObjectId id, Core.GitObject
7979

8080
internal Commit DereferenceToCommit(bool throwsIfCanNotBeDereferencedToACommit)
8181
{
82-
using (GitObjectSafeHandle peeledHandle = Proxy.git_object_peel(repo.Handle, Id, Core.GitObjectType.Commit, throwsIfCanNotBeDereferencedToACommit))
82+
using (GitObjectSafeHandle peeledHandle = Proxy.git_object_peel(repo.Handle, Id, GitObjectType.Commit, throwsIfCanNotBeDereferencedToACommit))
8383
{
8484
if (peeledHandle == null)
8585
{
8686
return null;
8787
}
8888

89-
return (Commit)BuildFrom(repo, Proxy.git_object_id(peeledHandle), Core.GitObjectType.Commit, null);
89+
return (Commit)BuildFrom(repo, Proxy.git_object_id(peeledHandle), GitObjectType.Commit, null);
9090
}
9191
}
9292

LibGit2Sharp/GitObjectType.cs

Lines changed: 0 additions & 69 deletions
This file was deleted.

LibGit2Sharp/IRepository.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,6 @@ public interface IRepository : IDisposable
8989
/// <returns>The new HEAD.</returns>
9090
Branch Checkout(string committishOrBranchSpec, CheckoutOptions checkoutOptions, CheckoutProgressHandler onCheckoutProgress);
9191

92-
/// <summary>
93-
/// Try to lookup an object by its <see cref = "ObjectId" /> and <see cref = "GitObjectType" />. If no matching object is found, null will be returned.
94-
/// </summary>
95-
/// <param name = "id">The id to lookup.</param>
96-
/// <param name = "type">The kind of GitObject being looked up</param>
97-
/// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns>
98-
[Obsolete("This method will be removed in the next release. Please use another Repository.Lookup() overload instead.")]
99-
GitObject Lookup(ObjectId id, GitObjectType type = GitObjectType.Any);
100-
101-
/// <summary>
102-
/// Try to lookup an object by its sha or a reference canonical name and <see cref = "GitObjectType" />. If no matching object is found, null will be returned.
103-
/// </summary>
104-
/// <param name = "objectish">A revparse spec for the object to lookup.</param>
105-
/// <param name = "type">The kind of <see cref = "GitObject" /> being looked up</param>
106-
/// <returns>The <see cref = "GitObject" /> or null if it was not found.</returns>
107-
[Obsolete("This method will be removed in the next release. Please use another Repository.Lookup() overload instead.")]
108-
GitObject Lookup(string objectish, GitObjectType type = GitObjectType.Any);
109-
11092
/// <summary>
11193
/// Try to lookup an object by its <see cref = "ObjectId" />. If no matching object is found, null will be returned.
11294
/// </summary>

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@
206206
<Compile Include="Core\GitIndexTime.cs" />
207207
<Compile Include="Core\GitIndexEntry.cs" />
208208
<Compile Include="GitObject.cs" />
209-
<Compile Include="GitObjectType.cs" />
210209
<Compile Include="Core\GitObjectType.cs" />
211210
<Compile Include="GitSortOptions.cs" />
212211
<Compile Include="Core\LambdaEqualityHelper.cs" />

LibGit2Sharp/ObjectType.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using LibGit2Sharp.Core;
23

34
namespace LibGit2Sharp
45
{
@@ -30,21 +31,21 @@ public enum ObjectType
3031

3132
internal static class ObjectTypeExtensions
3233
{
33-
public static Core.GitObjectType ToGitObjectType(this ObjectType type)
34+
public static GitObjectType ToGitObjectType(this ObjectType type)
3435
{
3536
switch (type)
3637
{
3738
case ObjectType.Commit:
38-
return Core.GitObjectType.Commit;
39+
return GitObjectType.Commit;
3940

4041
case ObjectType.Tree:
41-
return Core.GitObjectType.Tree;
42+
return GitObjectType.Tree;
4243

4344
case ObjectType.Blob:
44-
return Core.GitObjectType.Blob;
45+
return GitObjectType.Blob;
4546

4647
case ObjectType.Tag:
47-
return Core.GitObjectType.Tag;
48+
return GitObjectType.Tag;
4849

4950
default:
5051
throw new InvalidOperationException(string.Format("Cannot map {0} to a GitObjectType.", type));

LibGit2Sharp/OdbBackend.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,13 @@ private static class BackendEntryPoints
197197
private unsafe static int Read(
198198
out IntPtr buffer_p,
199199
out UIntPtr len_p,
200-
out Core.GitObjectType type_p,
200+
out GitObjectType type_p,
201201
IntPtr backend,
202202
ref GitOid oid)
203203
{
204204
buffer_p = IntPtr.Zero;
205205
len_p = UIntPtr.Zero;
206-
type_p = Core.GitObjectType.Bad;
206+
type_p = GitObjectType.Bad;
207207

208208
OdbBackend odbBackend = GCHandle.FromIntPtr(Marshal.ReadIntPtr(backend, GitOdbBackend.GCHandleOffset)).Target as OdbBackend;
209209

@@ -255,15 +255,15 @@ private unsafe static int ReadPrefix(
255255
out GitOid out_oid,
256256
out IntPtr buffer_p,
257257
out UIntPtr len_p,
258-
out Core.GitObjectType type_p,
258+
out GitObjectType type_p,
259259
IntPtr backend,
260260
ref GitOid short_oid,
261261
UIntPtr len)
262262
{
263263
out_oid = default(GitOid);
264264
buffer_p = IntPtr.Zero;
265265
len_p = UIntPtr.Zero;
266-
type_p = Core.GitObjectType.Bad;
266+
type_p = GitObjectType.Bad;
267267

268268
OdbBackend odbBackend = GCHandle.FromIntPtr(Marshal.ReadIntPtr(backend, GitOdbBackend.GCHandleOffset)).Target as OdbBackend;
269269

@@ -320,12 +320,12 @@ private unsafe static int ReadPrefix(
320320

321321
private static int ReadHeader(
322322
out UIntPtr len_p,
323-
out Core.GitObjectType type_p,
323+
out GitObjectType type_p,
324324
IntPtr backend,
325325
ref GitOid oid)
326326
{
327327
len_p = UIntPtr.Zero;
328-
type_p = Core.GitObjectType.Bad;
328+
type_p = GitObjectType.Bad;
329329

330330
OdbBackend odbBackend = GCHandle.FromIntPtr(Marshal.ReadIntPtr(backend, GitOdbBackend.GCHandleOffset)).Target as OdbBackend;
331331

@@ -360,7 +360,7 @@ private static unsafe int Write(
360360
IntPtr backend,
361361
IntPtr data,
362362
UIntPtr len,
363-
Core.GitObjectType type)
363+
GitObjectType type)
364364
{
365365
OdbBackend odbBackend = GCHandle.FromIntPtr(Marshal.ReadIntPtr(backend, GitOdbBackend.GCHandleOffset)).Target as OdbBackend;
366366

@@ -398,7 +398,7 @@ private static int WriteStream(
398398
out IntPtr stream_out,
399399
IntPtr backend,
400400
UIntPtr length,
401-
Core.GitObjectType type)
401+
GitObjectType type)
402402
{
403403
stream_out = IntPtr.Zero;
404404

LibGit2Sharp/ReferenceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static Reference Add(this ReferenceCollection refsColl, string name, stri
4747
Reference reference;
4848
RefState refState = TryResolveReference(out reference, refsColl, canonicalRefNameOrObjectish);
4949

50-
var gitObject = refsColl.repo.Lookup(canonicalRefNameOrObjectish, Core.GitObjectType.Any, LookUpOptions.None);
50+
var gitObject = refsColl.repo.Lookup(canonicalRefNameOrObjectish, GitObjectType.Any, LookUpOptions.None);
5151

5252
if (refState == RefState.Exists)
5353
{

LibGit2Sharp/Remote.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Globalization;
44
using LibGit2Sharp.Core;
55
using LibGit2Sharp.Core.Handles;
6-
using LibGit2Sharp.Handlers;
76

87
namespace LibGit2Sharp
98
{
@@ -51,28 +50,6 @@ internal static Remote BuildFromPtr(RemoteSafeHandle handle, Repository repo)
5150
/// </summary>
5251
public virtual string Url { get; private set; }
5352

54-
/// <summary>
55-
/// Fetch from the <see cref = "Remote" />.
56-
/// </summary>
57-
/// <param name="tagFetchMode">Optional parameter indicating what tags to download.</param>
58-
/// <param name="onProgress">Progress callback. Corresponds to libgit2 progress callback.</param>
59-
/// <param name="onCompletion">Completion callback. Corresponds to libgit2 completion callback.</param>
60-
/// <param name="onUpdateTips">UpdateTips callback. Corresponds to libgit2 update_tips callback.</param>
61-
/// <param name="onTransferProgress">Callback method that transfer progress will be reported through.
62-
/// Reports the client's state regarding the received and processed (bytes, objects) from the server.</param>
63-
/// <param name="credentials">Credentials to use for username/password authentication.</param>
64-
[Obsolete("This method will be removed in the next release. Please use Repository.Network.Fetch() instead.")]
65-
public virtual void Fetch(
66-
TagFetchMode tagFetchMode = TagFetchMode.Auto,
67-
ProgressHandler onProgress = null,
68-
CompletionHandler onCompletion = null,
69-
UpdateTipsHandler onUpdateTips = null,
70-
TransferProgressHandler onTransferProgress = null,
71-
Credentials credentials = null)
72-
{
73-
repository.Network.Fetch(this, tagFetchMode, onProgress, onCompletion, onUpdateTips, onTransferProgress, credentials);
74-
}
75-
7653
/// <summary>
7754
/// Transform a reference to its source reference using the <see cref = "Remote" />'s default fetchspec.
7855
/// </summary>

0 commit comments

Comments
 (0)