Skip to content

Applying consistant formatting across the project #1097

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
Jul 8, 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
12 changes: 4 additions & 8 deletions LibGit2Sharp/AmbiguousSpecificationException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ public class AmbiguousSpecificationException : LibGit2SharpException
/// Initializes a new instance of the <see cref="AmbiguousSpecificationException"/> class.
/// </summary>
public AmbiguousSpecificationException()
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="AmbiguousSpecificationException"/> class with a specified error message.
/// </summary>
/// <param name="message">A message that describes the error.</param>
public AmbiguousSpecificationException(string message)
: base(message)
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="AmbiguousSpecificationException"/> class with a specified error message.
Expand All @@ -44,8 +42,7 @@ public AmbiguousSpecificationException(CultureInfo cultureInfo, string format, p
/// <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>
public AmbiguousSpecificationException(string message, Exception innerException)
: base(message, innerException)
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="AmbiguousSpecificationException"/> class with a serialized data.
Expand All @@ -54,7 +51,6 @@ public AmbiguousSpecificationException(string message, Exception innerException)
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected AmbiguousSpecificationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
{ }
}
}
15 changes: 5 additions & 10 deletions LibGit2Sharp/BareRepositoryException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ public class BareRepositoryException : LibGit2SharpException
/// Initializes a new instance of the <see cref="LibGit2Sharp.BareRepositoryException"/> class.
/// </summary>
public BareRepositoryException()
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="LibGit2Sharp.BareRepositoryException"/> class with a specified error message.
/// </summary>
/// <param name="message">A message that describes the error.</param>
public BareRepositoryException(string message)
: base(message)
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="LibGit2Sharp.BareRepositoryException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
Expand All @@ -34,8 +32,7 @@ public BareRepositoryException(string message)
/// <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>
public BareRepositoryException(string message, Exception innerException)
: base(message, innerException)
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="LibGit2Sharp.BareRepositoryException"/> class with a serialized data.
Expand All @@ -44,12 +41,10 @@ public BareRepositoryException(string message, Exception innerException)
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected BareRepositoryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
{ }

internal BareRepositoryException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
{
}
{ }
}
}
4 changes: 3 additions & 1 deletion LibGit2Sharp/BlameHunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ internal BlameHunk(IRepository repository, GitBlameHunk rawHunk)
{
FinalSignature = new Signature(Proxy.git_signature_dup(rawHunk.FinalSignature));
}

if (rawHunk.OrigSignature != IntPtr.Zero)
{
InitialSignature = new Signature(Proxy.git_signature_dup(rawHunk.OrigSignature));
Expand All @@ -49,7 +50,8 @@ internal BlameHunk(IRepository repository, GitBlameHunk rawHunk)
/// <summary>
/// For easier mocking
/// </summary>
protected BlameHunk() { }
protected BlameHunk()
{ }

/// <summary>
/// Determine if this hunk contains a given line.
Expand Down
2 changes: 2 additions & 0 deletions LibGit2Sharp/BlameHunkCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ internal BlameHunkCollection(Repository repo, RepositorySafeHandle repoHandle, s
MinLine = (uint)options.MinLine,
MaxLine = (uint)options.MaxLine,
};

if (options.StartingAt != null)
{
rawopts.NewestCommit = repo.Committish(options.StartingAt).Oid;
}

if (options.StoppingAt != null)
{
rawopts.OldestCommit = repo.Committish(options.StoppingAt).Oid;
Expand Down
12 changes: 5 additions & 7 deletions LibGit2Sharp/Branch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ protected Branch()
/// <param name="canonicalName">The full name of the reference</param>
internal Branch(Repository repo, Reference reference, string canonicalName)
: this(repo, reference, _ => canonicalName)
{
}
{ }

/// <summary>
/// Initializes a new instance of an orphaned <see cref="Branch"/> class.
Expand All @@ -38,8 +37,7 @@ internal Branch(Repository repo, Reference reference, string canonicalName)
/// <param name="reference">The reference.</param>
internal Branch(Repository repo, Reference reference)
: this(repo, reference, r => r.TargetIdentifier)
{
}
{ }

private Branch(Repository repo, Reference reference, Func<Reference, string> canonicalNameSelector)
: base(repo, reference, canonicalNameSelector)
Expand Down Expand Up @@ -264,9 +262,9 @@ protected override string Shorten()
return CanonicalName.Substring(Reference.RemoteTrackingBranchPrefix.Length);
}

throw new ArgumentException(
string.Format(CultureInfo.InvariantCulture,
"'{0}' does not look like a valid branch name.", CanonicalName));
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
"'{0}' does not look like a valid branch name.",
CanonicalName));
}
}
}
15 changes: 6 additions & 9 deletions LibGit2Sharp/BranchCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private Branch BuildFromReferenceName(string canonicalName)
public virtual IEnumerator<Branch> GetEnumerator()
{
return Proxy.git_branch_iterator(repo, GitBranchType.GIT_BRANCH_ALL)
.ToList().GetEnumerator();
.ToList()
.GetEnumerator();
}

/// <summary>
Expand Down Expand Up @@ -154,7 +155,8 @@ public virtual Branch Add(string name, string committish, bool allowOverwrite)
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(committish, "committish");

using (Proxy.git_branch_create_from_annotated(repo.Handle, name, committish, allowOverwrite)) { }
using (Proxy.git_branch_create_from_annotated(repo.Handle, name, committish, allowOverwrite))
{ }

var branch = this[ShortToLocalName(name)];
return branch;
Expand Down Expand Up @@ -269,8 +271,7 @@ public virtual Branch Rename(Branch branch, string newName, bool allowOverwrite)
using (ReferenceSafeHandle referencePtr = repo.Refs.RetrieveReferencePtr(Reference.LocalBranchPrefix + branch.FriendlyName))
{
using (Proxy.git_branch_move(referencePtr, newName, allowOverwrite))
{
}
{ }
}

var newBranch = this[newName];
Expand Down Expand Up @@ -304,11 +305,7 @@ private static bool LooksLikeABranchName(string referenceName)

private string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"Count = {0}", this.Count());
}
get { return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count()); }
}
}
}
3 changes: 2 additions & 1 deletion LibGit2Sharp/BranchUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ private void GetUpstreamInformation(string canonicalName, out string remoteName,
else
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
"'{0}' does not look like a valid canonical branch name.", canonicalName));
"'{0}' does not look like a valid canonical branch name.",
canonicalName));
}
}
}
Expand Down
15 changes: 5 additions & 10 deletions LibGit2Sharp/CheckoutConflictException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ public class CheckoutConflictException : LibGit2SharpException
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class.
/// </summary>
public CheckoutConflictException()
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a specified error message.
/// </summary>
/// <param name="message">A message that describes the error.</param>
public CheckoutConflictException(string message)
: base(message)
{
}
{ }

/// <summary>
/// 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.
Expand All @@ -35,8 +33,7 @@ public CheckoutConflictException(string message)
/// <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>
public CheckoutConflictException(string message, Exception innerException)
: base(message, innerException)
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="LibGit2Sharp.CheckoutConflictException"/> class with a serialized data.
Expand All @@ -45,12 +42,10 @@ public CheckoutConflictException(string message, Exception innerException)
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected CheckoutConflictException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
{ }

internal CheckoutConflictException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
{
}
{ }
}
}
5 changes: 3 additions & 2 deletions LibGit2Sharp/CheckoutOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ CheckoutStrategy IConvertableToGitCheckoutOpts.CheckoutStrategy
{
get
{
return CheckoutModifiers.HasFlag(CheckoutModifiers.Force) ?
CheckoutStrategy.GIT_CHECKOUT_FORCE : CheckoutStrategy.GIT_CHECKOUT_SAFE;
return CheckoutModifiers.HasFlag(CheckoutModifiers.Force)
? CheckoutStrategy.GIT_CHECKOUT_FORCE
: CheckoutStrategy.GIT_CHECKOUT_SAFE;
}
}

Expand Down
3 changes: 1 addition & 2 deletions LibGit2Sharp/CherryPickOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ public sealed class CherryPickOptions : MergeAndCheckoutOptionsBase
/// By default the cherry pick will be committed if there are no conflicts.
/// </summary>
public CherryPickOptions()
{
}
{ }

/// <summary>
/// When cherry picking a merge commit, the parent number to consider as
Expand Down
6 changes: 3 additions & 3 deletions LibGit2Sharp/CloneOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ CheckoutStrategy IConvertableToGitCheckoutOpts.CheckoutStrategy
{
get
{
return this.Checkout ?
CheckoutStrategy.GIT_CHECKOUT_SAFE :
CheckoutStrategy.GIT_CHECKOUT_NONE;
return this.Checkout
? CheckoutStrategy.GIT_CHECKOUT_SAFE
: CheckoutStrategy.GIT_CHECKOUT_NONE;
}
}

Expand Down
4 changes: 3 additions & 1 deletion LibGit2Sharp/Commit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
"{0} {1}", Id.ToString(7), MessageShort);
"{0} {1}",
Id.ToString(7),
MessageShort);
}
}

Expand Down
12 changes: 6 additions & 6 deletions LibGit2Sharp/CommitFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ private static IList<object> ToList(object obj)
}

var types = new[]
{
typeof(string), typeof(ObjectId),
typeof(Commit), typeof(TagAnnotation),
typeof(Tag), typeof(Branch), typeof(DetachedHead),
typeof(Reference), typeof(DirectReference), typeof(SymbolicReference)
};
{
typeof(string), typeof(ObjectId),
typeof(Commit), typeof(TagAnnotation),
typeof(Tag), typeof(Branch), typeof(DetachedHead),
typeof(Reference), typeof(DirectReference), typeof(SymbolicReference)
};

if (types.Contains(obj.GetType()))
{
Expand Down
5 changes: 2 additions & 3 deletions LibGit2Sharp/CommitLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public sealed class CommitLog : IQueryableCommitLog
/// <param name="repo">The repository.</param>
internal CommitLog(Repository repo)
: this(repo, new CommitFilter())
{
}
{ }

/// <summary>
/// Initializes a new instance of the <see cref="CommitLog"/> class.
Expand Down Expand Up @@ -103,7 +102,7 @@ public IEnumerable<LogEntry> QueryBy(string path, FollowFilter filter)
Ensure.ArgumentNotNull(path, "path");
Ensure.ArgumentNotNull(filter, "filter");

return new FileHistory(repo, path, new CommitFilter {SortBy = filter.SortBy});
return new FileHistory(repo, path, new CommitFilter { SortBy = filter.SortBy });
}

/// <summary>
Expand Down
29 changes: 15 additions & 14 deletions LibGit2Sharp/CommitRewriteInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ public sealed class CommitRewriteInfo
public static CommitRewriteInfo From(Commit commit)
{
return new CommitRewriteInfo
{
Author = commit.Author,
Committer = commit.Committer,
Message = commit.Message
};
{
Author = commit.Author,
Committer = commit.Committer,
Message = commit.Message
};
}

/// <summary>
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
/// optionally overriding some of its properties
/// </summary>
/// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param>
/// <summary>
/// Build a <see cref="CommitRewriteInfo"/> from the <see cref="Commit"/> passed in,
/// optionally overriding some of its properties
/// </summary>
/// <param name="commit">The <see cref="Commit"/> whose information is to be copied</param>
/// <param name="author">Optional override for the author</param>
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
Expand Down Expand Up @@ -85,10 +85,11 @@ public static CommitRewriteInfo From(Commit commit, Signature author, Signature
/// <param name="message">Optional override for the message</param>
/// <returns>A new <see cref="CommitRewriteInfo"/> object that matches the info for the
/// <paramref name="commit"/> with the optional parameters replaced..</returns>
public static CommitRewriteInfo From(Commit commit,
Signature author,
Signature committer,
string message)
public static CommitRewriteInfo From(
Commit commit,
Signature author,
Signature committer,
string message)
{
var cri = From(commit);
cri.Author = author ?? cri.Author;
Expand Down
Loading