Skip to content

#1098 Deploy usage of support for message formatting in exception c'tors #1198

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
Oct 4, 2015
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions LibGit2Sharp/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,9 @@ private ConfigurationSafeHandle RetrieveConfigurationHandle(ConfigurationLevel l

if (handle == null && throwIfStoreHasNotBeenFound)
{
throw new LibGit2SharpException(string.Format(CultureInfo.InvariantCulture,
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"No {0} configuration file has been found.",
Enum.GetName(typeof(ConfigurationLevel), level)));
Enum.GetName(typeof(ConfigurationLevel), level));
}

return handle;
Expand Down
4 changes: 2 additions & 2 deletions LibGit2Sharp/Core/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1432,9 +1432,9 @@ public static IntPtr git_odb_backend_malloc(IntPtr backend, UIntPtr len)

if (IntPtr.Zero == toReturn)
{
throw new LibGit2SharpException(String.Format(CultureInfo.InvariantCulture,
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Unable to allocate {0} bytes; out of memory",
len),
len,
GitErrorCode.Error,
GitErrorCategory.NoMemory);
}
Expand Down
3 changes: 1 addition & 2 deletions LibGit2Sharp/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,9 @@ public virtual void Push(
if (string.IsNullOrEmpty(branch.UpstreamBranchCanonicalName))
{
throw new LibGit2SharpException(
string.Format(
CultureInfo.InvariantCulture,
"The branch '{0}' (\"{1}\") that you are trying to push does not track an upstream branch.",
branch.FriendlyName, branch.CanonicalName));
branch.FriendlyName, branch.CanonicalName);
}
}

Expand Down
6 changes: 4 additions & 2 deletions LibGit2Sharp/Rebase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Handles;
using System.Globalization;

namespace LibGit2Sharp
{
Expand Down Expand Up @@ -80,8 +81,9 @@ public virtual RebaseResult Start(Branch branch, Branch upstream, Branch onto, I

if (this.repository.Info.CurrentOperation != CurrentOperation.None)
{
throw new LibGit2SharpException(string.Format(
"A {0} operation is already in progress.", this.repository.Info.CurrentOperation));
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"A {0} operation is already in progress.",
this.repository.Info.CurrentOperation);
}

Func<Branch, ReferenceSafeHandle> RefHandleFromBranch = (Branch b) =>
Expand Down
5 changes: 3 additions & 2 deletions LibGit2Sharp/RebaseOperationImpl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using LibGit2Sharp.Core;
using System.Globalization;

namespace LibGit2Sharp
{
Expand Down Expand Up @@ -118,9 +119,9 @@ private static RebaseResult RunRebaseStep(RebaseSafeHandle rebaseOperationHandle
case RebaseStepOperation.Fixup:
case RebaseStepOperation.Reword:
// These operations are not yet supported by lg2.
throw new LibGit2SharpException(string.Format(
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Rebase Operation Type ({0}) is not currently supported in LibGit2Sharp.",
stepToApplyInfo.Type));
stepToApplyInfo.Type);
default:
throw new ArgumentException(string.Format(
"Unexpected Rebase Operation Type: {0}", stepToApplyInfo.Type));
Expand Down
5 changes: 3 additions & 2 deletions LibGit2Sharp/ReferenceCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,9 @@ public virtual Reference Rename(string currentName, string newName,
if (reference == null)
{
throw new LibGit2SharpException(
string.Format(CultureInfo.InvariantCulture,
"Reference '{0}' doesn't exist. One cannot move a non existing reference.", currentName));
CultureInfo.InvariantCulture,
"Reference '{0}' doesn't exist. One cannot move a non existing reference.",
currentName);
}

return Rename(reference, newName, logMessage, allowOverwrite);
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/UnbornBranchException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public UnbornBranchException(string message)
/// <param name="format">A composite format string for use in <see cref="String.Format(IFormatProvider, string, object[])"/>.</param>
/// <param name="args">An object array that contains zero or more objects to format.</param>
public UnbornBranchException(CultureInfo cultureInfo, string format, params object[] args)
: base(String.Format(cultureInfo, format, args))
: base(cultureInfo, format, args)
{ }

/// <summary>
Expand Down