Skip to content

Commit 4b8d5ad

Browse files
committed
Merge branch 'cmn/delete-deprecations'
2 parents 6a22577 + 3bbf91c commit 4b8d5ad

17 files changed

+37
-436
lines changed

LibGit2Sharp.Tests/CheckoutFixture.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,23 +1029,6 @@ public void CanCheckoutPathFromCurrentBranch(string fileName)
10291029
}
10301030
}
10311031

1032-
[Fact]
1033-
public void CanCatchDeprecatedException()
1034-
{
1035-
bool caught = false;
1036-
1037-
try
1038-
{
1039-
throw new CheckoutConflictException();
1040-
}
1041-
catch (MergeConflictException)
1042-
{
1043-
caught = true;
1044-
}
1045-
1046-
Assert.True(caught);
1047-
}
1048-
10491032
/// <summary>
10501033
/// Helper method to populate a simple repository with
10511034
/// a single file and two branches.

LibGit2Sharp/CheckoutConflictException.cs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Runtime.Serialization;
23
using LibGit2Sharp.Core;
34

45
namespace LibGit2Sharp
@@ -9,14 +10,49 @@ namespace LibGit2Sharp
910
/// in the working directory.
1011
/// </summary>
1112
[Serializable]
12-
public class CheckoutConflictException : MergeConflictException
13+
public class CheckoutConflictException : LibGit2SharpException
1314
{
1415
/// <summary>
1516
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class.
1617
/// </summary>
1718
public CheckoutConflictException()
1819
{ }
1920

21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a specified error message.
23+
/// </summary>
24+
/// <param name="message">A message that describes the error.</param>
25+
public CheckoutConflictException(string message)
26+
: base(message)
27+
{ }
28+
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a specified error message.
31+
/// </summary>
32+
/// <param name="format">A composite format string for use in <see cref="String.Format(IFormatProvider, string, object[])"/>.</param>
33+
/// <param name="args">An object array that contains zero or more objects to format.</param>
34+
public CheckoutConflictException(string format, params object[] args)
35+
: base(format, args)
36+
{ }
37+
38+
/// <summary>
39+
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
40+
/// </summary>
41+
/// <param name="message">The error message that explains the reason for the exception.</param>
42+
/// <param name="innerException">The exception that is the cause of the current exception. If the <paramref name="innerException"/> parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
43+
public CheckoutConflictException(string message, Exception innerException)
44+
: base(message, innerException)
45+
{ }
46+
47+
/// <summary>
48+
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a serialized data.
49+
/// </summary>
50+
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
51+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
52+
protected CheckoutConflictException(SerializationInfo info, StreamingContext context)
53+
: base(info, context)
54+
{ }
55+
2056
internal CheckoutConflictException(string message, GitErrorCode code, GitErrorCategory category)
2157
: base(message, code, category)
2258
{ }

LibGit2Sharp/CommitFilter.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,6 @@ public CommitFilter()
2828
/// </summary>
2929
public CommitSortStrategies SortBy { get; set; }
3030

31-
/// <summary>
32-
/// A pointer to a commit object or a list of pointers to consider as starting points.
33-
/// <para>
34-
/// Can be either a <see cref="string"/> containing the sha or reference canonical name to use,
35-
/// a <see cref="Branch"/>, a <see cref="Reference"/>, a <see cref="Commit"/>, a <see cref="Tag"/>,
36-
/// a <see cref="TagAnnotation"/>, an <see cref="ObjectId"/> or even a mixed collection of all of the above.
37-
/// By default, the <see cref="Repository.Head"/> will be used as boundary.
38-
/// </para>
39-
/// </summary>
40-
[Obsolete("This property will be removed in the next release. Please use IncludeReachableFrom instead.")]
41-
public object Since
42-
{
43-
get { return IncludeReachableFrom; }
44-
set { IncludeReachableFrom = value; }
45-
}
46-
4731
/// <summary>
4832
/// A pointer to a commit object or a list of pointers to consider as starting points.
4933
/// <para>
@@ -60,21 +44,6 @@ internal IList<object> SinceList
6044
get { return ToList(IncludeReachableFrom); }
6145
}
6246

63-
/// <summary>
64-
/// A pointer to a commit object or a list of pointers which will be excluded (along with ancestors) from the enumeration.
65-
/// <para>
66-
/// Can be either a <see cref="string"/> containing the sha or reference canonical name to use,
67-
/// a <see cref="Branch"/>, a <see cref="Reference"/>, a <see cref="Commit"/>, a <see cref="Tag"/>,
68-
/// a <see cref="TagAnnotation"/>, an <see cref="ObjectId"/> or even a mixed collection of all of the above.
69-
/// </para>
70-
/// </summary>
71-
[Obsolete("This property will be removed in the next release. Please use ExcludeReachableFrom instead.")]
72-
public object Until
73-
{
74-
get { return ExcludeReachableFrom; }
75-
set { ExcludeReachableFrom = value; }
76-
}
77-
7847
/// <summary>
7948
/// A pointer to a commit object or a list of pointers which will be excluded (along with ancestors) from the enumeration.
8049
/// <para>

LibGit2Sharp/CommitLog.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -105,30 +105,6 @@ public IEnumerable<LogEntry> QueryBy(string path, FollowFilter filter)
105105
return new FileHistory(repo, path, new CommitFilter { SortBy = filter.SortBy });
106106
}
107107

108-
/// <summary>
109-
/// Find the best possible merge base given two <see cref="Commit"/>s.
110-
/// </summary>
111-
/// <param name="first">The first <see cref="Commit"/>.</param>
112-
/// <param name="second">The second <see cref="Commit"/>.</param>
113-
/// <returns>The merge base or null if none found.</returns>
114-
[Obsolete("This method will be removed in the next release. Please use ObjectDatabase.FindMergeBase() instead.")]
115-
public Commit FindMergeBase(Commit first, Commit second)
116-
{
117-
return repo.ObjectDatabase.FindMergeBase(first, second);
118-
}
119-
120-
/// <summary>
121-
/// Find the best possible merge base given two or more <see cref="Commit"/> according to the <see cref="MergeBaseFindingStrategy"/>.
122-
/// </summary>
123-
/// <param name="commits">The <see cref="Commit"/>s for which to find the merge base.</param>
124-
/// <param name="strategy">The strategy to leverage in order to find the merge base.</param>
125-
/// <returns>The merge base or null if none found.</returns>
126-
[Obsolete("This method will be removed in the next release. Please use ObjectDatabase.FindMergeBase() instead.")]
127-
public Commit FindMergeBase(IEnumerable<Commit> commits, MergeBaseFindingStrategy strategy)
128-
{
129-
return repo.ObjectDatabase.FindMergeBase(commits, strategy);
130-
}
131-
132108
private class CommitEnumerator : IEnumerator<Commit>
133109
{
134110
private readonly Repository repo;

LibGit2Sharp/CompareOptions.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ public CompareOptions()
3939
/// </summary>
4040
public bool IncludeUnmodified { get; set; }
4141

42-
/// <summary>
43-
/// Use the "patience diff" algorithm.
44-
/// </summary>
45-
[Obsolete("This property will be removed in the next release. Please use Algorithm instead.")]
46-
public bool UsePatienceAlgorithm { get; set; }
47-
4842
/// <summary>
4943
/// Algorithm to be used when performing a Diff.
5044
/// By default, <see cref="DiffAlgorithm.Myers"/> will be used.

LibGit2Sharp/Configuration.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -195,36 +195,6 @@ public static Configuration BuildFrom(
195195
return new Configuration(null, repositoryConfigurationFileLocation, globalConfigurationFileLocation, xdgConfigurationFileLocation, systemConfigurationFileLocation);
196196
}
197197

198-
/// <summary>
199-
/// Access configuration values without a repository. Generally you want to access configuration via an instance of <see cref="Repository"/> instead.
200-
/// </summary>
201-
/// <param name="globalConfigurationFileLocation">Path to a Global configuration file. If null, the default path for a global configuration file will be probed.</param>
202-
[Obsolete("This method will be removed in the next release. Please use Configuration.BuildFrom(string, string) instead.")]
203-
public Configuration(string globalConfigurationFileLocation)
204-
: this(null, null, globalConfigurationFileLocation, null, null)
205-
{ }
206-
207-
/// <summary>
208-
/// Access configuration values without a repository. Generally you want to access configuration via an instance of <see cref="Repository"/> instead.
209-
/// </summary>
210-
/// <param name="globalConfigurationFileLocation">Path to a Global configuration file. If null, the default path for a global configuration file will be probed.</param>
211-
/// <param name="xdgConfigurationFileLocation">Path to a XDG configuration file. If null, the default path for a XDG configuration file will be probed.</param>
212-
[Obsolete("This method will be removed in the next release. Please use Configuration.BuildFrom(string, string, string) instead.")]
213-
public Configuration(string globalConfigurationFileLocation, string xdgConfigurationFileLocation)
214-
: this(null, null, globalConfigurationFileLocation, xdgConfigurationFileLocation, null)
215-
{ }
216-
217-
/// <summary>
218-
/// Access configuration values without a repository. Generally you want to access configuration via an instance of <see cref="Repository"/> instead.
219-
/// </summary>
220-
/// <param name="globalConfigurationFileLocation">Path to a Global configuration file. If null, the default path for a global configuration file will be probed.</param>
221-
/// <param name="xdgConfigurationFileLocation">Path to a XDG configuration file. If null, the default path for a XDG configuration file will be probed.</param>
222-
/// <param name="systemConfigurationFileLocation">Path to a System configuration file. If null, the default path for a system configuration file will be probed.</param>
223-
[Obsolete("This method will be removed in the next release. Please use Configuration.BuildFrom(string, string, string, string) instead.")]
224-
public Configuration(string globalConfigurationFileLocation, string xdgConfigurationFileLocation, string systemConfigurationFileLocation)
225-
: this(null, null, globalConfigurationFileLocation, xdgConfigurationFileLocation, systemConfigurationFileLocation)
226-
{ }
227-
228198
/// <summary>
229199
/// Determines which configuration file has been found.
230200
/// </summary>

LibGit2Sharp/FileStatus.cs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,16 @@ public enum FileStatus
1818
/// </summary>
1919
Unaltered = 0, /* GIT_STATUS_CURRENT */
2020

21-
/// <summary>
22-
/// New file has been added to the Index. It's unknown from the Head.
23-
/// </summary>
24-
[Obsolete("This enum member will be removed in the next release. Please use NewInIndex instead.")]
25-
Added = (1 << 0), /* GIT_STATUS_INDEX_NEW */
26-
2721
/// <summary>
2822
/// New file has been added to the Index. It's unknown from the Head.
2923
/// </summary>
3024
NewInIndex = (1 << 0), /* GIT_STATUS_INDEX_NEW */
3125

32-
/// <summary>
33-
/// New version of a file has been added to the Index. A previous version exists in the Head.
34-
/// </summary>
35-
[Obsolete("This enum member will be removed in the next release. Please use ModifiedInIndex instead.")]
36-
Staged = (1 << 1), /* GIT_STATUS_INDEX_MODIFIED */
37-
3826
/// <summary>
3927
/// New version of a file has been added to the Index. A previous version exists in the Head.
4028
/// </summary>
4129
ModifiedInIndex = (1 << 1), /* GIT_STATUS_INDEX_MODIFIED */
4230

43-
/// <summary>
44-
/// The deletion of a file has been promoted from the working directory to the Index. A previous version exists in the Head.
45-
/// </summary>
46-
[Obsolete("This enum member will be removed in the next release. Please use DeletedFromIndex instead.")]
47-
Removed = (1 << 2), /* GIT_STATUS_INDEX_DELETED */
48-
4931
/// <summary>
5032
/// The deletion of a file has been promoted from the working directory to the Index. A previous version exists in the Head.
5133
/// </summary>
@@ -56,56 +38,26 @@ public enum FileStatus
5638
/// </summary>
5739
RenamedInIndex = (1 << 3), /* GIT_STATUS_INDEX_RENAMED */
5840

59-
/// <summary>
60-
/// A change in type for a file has been promoted from the working directory to the Index. A previous version exists in the Head.
61-
/// </summary>
62-
[Obsolete("This enum member will be removed in the next release. Please use TypeChangeInIndex instead.")]
63-
StagedTypeChange = (1 << 4), /* GIT_STATUS_INDEX_TYPECHANGE */
64-
6541
/// <summary>
6642
/// A change in type for a file has been promoted from the working directory to the Index. A previous version exists in the Head.
6743
/// </summary>
6844
TypeChangeInIndex = (1 << 4), /* GIT_STATUS_INDEX_TYPECHANGE */
6945

70-
/// <summary>
71-
/// New file in the working directory, unknown from the Index and the Head.
72-
/// </summary>
73-
[Obsolete("This enum member will be removed in the next release. Please use NewInWorkdir instead.")]
74-
Untracked = (1 << 7), /* GIT_STATUS_WT_NEW */
75-
7646
/// <summary>
7747
/// New file in the working directory, unknown from the Index and the Head.
7848
/// </summary>
7949
NewInWorkdir = (1 << 7), /* GIT_STATUS_WT_NEW */
8050

81-
/// <summary>
82-
/// The file has been updated in the working directory. A previous version exists in the Index.
83-
/// </summary>
84-
[Obsolete("This enum member will be removed in the next release. Please use ModifiedInWorkdir instead.")]
85-
Modified = (1 << 8), /* GIT_STATUS_WT_MODIFIED */
86-
8751
/// <summary>
8852
/// The file has been updated in the working directory. A previous version exists in the Index.
8953
/// </summary>
9054
ModifiedInWorkdir = (1 << 8), /* GIT_STATUS_WT_MODIFIED */
9155

92-
/// <summary>
93-
/// The file has been deleted from the working directory. A previous version exists in the Index.
94-
/// </summary>
95-
[Obsolete("This enum member will be removed in the next release. Please use DeletedFromWorkdir instead.")]
96-
Missing = (1 << 9), /* GIT_STATUS_WT_DELETED */
97-
9856
/// <summary>
9957
/// The file has been deleted from the working directory. A previous version exists in the Index.
10058
/// </summary>
10159
DeletedFromWorkdir = (1 << 9), /* GIT_STATUS_WT_DELETED */
10260

103-
/// <summary>
104-
/// The file type has been changed in the working directory. A previous version exists in the Index.
105-
/// </summary>
106-
[Obsolete("This enum member will be removed in the next release. Please use TypeChangeInWorkdir instead.")]
107-
TypeChanged = (1 << 10), /* GIT_STATUS_WT_TYPECHANGE */
108-
10961
/// <summary>
11062
/// The file type has been changed in the working directory. A previous version exists in the Index.
11163
/// </summary>

LibGit2Sharp/IQueryableCommitLog.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,5 @@ public interface IQueryableCommitLog : ICommitLog
2929
/// <param name="filter">The options used to control which commits will be returned.</param>
3030
/// <returns>A list of file history entries, ready to be enumerated.</returns>
3131
IEnumerable<LogEntry> QueryBy(string path, FollowFilter filter);
32-
33-
/// <summary>
34-
/// Find the best possible merge base given two <see cref="Commit"/>s.
35-
/// </summary>
36-
/// <param name="first">The first <see cref="Commit"/>.</param>
37-
/// <param name="second">The second <see cref="Commit"/>.</param>
38-
/// <returns>The merge base or null if none found.</returns>
39-
[Obsolete("This method will be removed in the next release. Please use ObjectDatabase.FindMergeBase() instead.")]
40-
Commit FindMergeBase(Commit first, Commit second);
41-
42-
/// <summary>
43-
/// Find the best possible merge base given two or more <see cref="Commit"/> according to the <see cref="MergeBaseFindingStrategy"/>.
44-
/// </summary>
45-
/// <param name="commits">The <see cref="Commit"/>s for which to find the merge base.</param>
46-
/// <param name="strategy">The strategy to leverage in order to find the merge base.</param>
47-
/// <returns>The merge base or null if none found.</returns>
48-
[Obsolete("This method will be removed in the next release. Please use ObjectDatabase.FindMergeBase() instead.")]
49-
Commit FindMergeBase(IEnumerable<Commit> commits, MergeBaseFindingStrategy strategy);
5032
}
5133
}

LibGit2Sharp/IRepository.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,6 @@ public interface IRepository : IDisposable
174174
/// <param name="options">Collection of parameters controlling checkout behavior.</param>
175175
void Reset(ResetMode resetMode, Commit commit, CheckoutOptions options);
176176

177-
/// <summary>
178-
/// Replaces entries in the <see cref="Repository.Index"/> with entries from the specified commit.
179-
/// </summary>
180-
/// <param name="commit">The target commit object.</param>
181-
/// <param name="paths">The list of paths (either files or directories) that should be considered.</param>
182-
/// <param name="explicitPathsOptions">
183-
/// If set, the passed <paramref name="paths"/> will be treated as explicit paths.
184-
/// Use these options to determine how unmatched explicit paths should be handled.
185-
/// </param>
186-
[Obsolete("This method will be removed in the next release. Please use Index.Replace() instead.")]
187-
void Reset(Commit commit, IEnumerable<string> paths, ExplicitPathsOptions explicitPathsOptions);
188-
189177
/// <summary>
190178
/// Clean the working tree by removing files that are not under version control.
191179
/// </summary>

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
2424
<ErrorReport>prompt</ErrorReport>
2525
<WarningLevel>4</WarningLevel>
26-
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
2726
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2827
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
2928
<DocumentationFile>bin\Debug\LibGit2Sharp.xml</DocumentationFile>
@@ -36,7 +35,6 @@
3635
<ErrorReport>prompt</ErrorReport>
3736
<WarningLevel>4</WarningLevel>
3837
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
39-
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
4038
<DocumentationFile>bin\Release\LibGit2Sharp.xml</DocumentationFile>
4139
</PropertyGroup>
4240
<PropertyGroup>
@@ -255,7 +253,6 @@
255253
<Compile Include="FetchHead.cs" />
256254
<Compile Include="Handlers.cs" />
257255
<Compile Include="Ignore.cs" />
258-
<Compile Include="MergeConflictException.cs" />
259256
<Compile Include="MergeHead.cs" />
260257
<Compile Include="NameConflictException.cs" />
261258
<Compile Include="NonFastForwardException.cs" />

0 commit comments

Comments
 (0)