diff --git a/LibGit2Sharp/AmbiguousSpecificationException.cs b/LibGit2Sharp/AmbiguousSpecificationException.cs
index ec6352b68..577b84f1a 100644
--- a/LibGit2Sharp/AmbiguousSpecificationException.cs
+++ b/LibGit2Sharp/AmbiguousSpecificationException.cs
@@ -14,8 +14,7 @@ public class AmbiguousSpecificationException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public AmbiguousSpecificationException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public AmbiguousSpecificationException()
/// A message that describes the error.
public AmbiguousSpecificationException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -44,8 +42,7 @@ public AmbiguousSpecificationException(CultureInfo cultureInfo, string format, p
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public AmbiguousSpecificationException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -54,7 +51,6 @@ public AmbiguousSpecificationException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected AmbiguousSpecificationException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/BareRepositoryException.cs b/LibGit2Sharp/BareRepositoryException.cs
index 00b61a04b..33c25f129 100644
--- a/LibGit2Sharp/BareRepositoryException.cs
+++ b/LibGit2Sharp/BareRepositoryException.cs
@@ -15,8 +15,7 @@ public class BareRepositoryException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public BareRepositoryException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public BareRepositoryException()
/// A message that describes the error.
public BareRepositoryException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -34,8 +32,7 @@ public BareRepositoryException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public BareRepositoryException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -44,12 +41,10 @@ public BareRepositoryException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected BareRepositoryException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal BareRepositoryException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/BlameHunk.cs b/LibGit2Sharp/BlameHunk.cs
index 79dbf3945..93d711c7a 100644
--- a/LibGit2Sharp/BlameHunk.cs
+++ b/LibGit2Sharp/BlameHunk.cs
@@ -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));
@@ -49,7 +50,8 @@ internal BlameHunk(IRepository repository, GitBlameHunk rawHunk)
///
/// For easier mocking
///
- protected BlameHunk() { }
+ protected BlameHunk()
+ { }
///
/// Determine if this hunk contains a given line.
diff --git a/LibGit2Sharp/BlameHunkCollection.cs b/LibGit2Sharp/BlameHunkCollection.cs
index f487915cd..35b945523 100644
--- a/LibGit2Sharp/BlameHunkCollection.cs
+++ b/LibGit2Sharp/BlameHunkCollection.cs
@@ -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;
diff --git a/LibGit2Sharp/Branch.cs b/LibGit2Sharp/Branch.cs
index bb8c45c67..905d94132 100644
--- a/LibGit2Sharp/Branch.cs
+++ b/LibGit2Sharp/Branch.cs
@@ -25,8 +25,7 @@ protected Branch()
/// The full name of the reference
internal Branch(Repository repo, Reference reference, string canonicalName)
: this(repo, reference, _ => canonicalName)
- {
- }
+ { }
///
/// Initializes a new instance of an orphaned class.
@@ -38,8 +37,7 @@ internal Branch(Repository repo, Reference reference, string canonicalName)
/// The reference.
internal Branch(Repository repo, Reference reference)
: this(repo, reference, r => r.TargetIdentifier)
- {
- }
+ { }
private Branch(Repository repo, Reference reference, Func canonicalNameSelector)
: base(repo, reference, canonicalNameSelector)
@@ -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));
}
}
}
diff --git a/LibGit2Sharp/BranchCollection.cs b/LibGit2Sharp/BranchCollection.cs
index df38d241a..5bb21c9a9 100644
--- a/LibGit2Sharp/BranchCollection.cs
+++ b/LibGit2Sharp/BranchCollection.cs
@@ -92,7 +92,8 @@ private Branch BuildFromReferenceName(string canonicalName)
public virtual IEnumerator GetEnumerator()
{
return Proxy.git_branch_iterator(repo, GitBranchType.GIT_BRANCH_ALL)
- .ToList().GetEnumerator();
+ .ToList()
+ .GetEnumerator();
}
///
@@ -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;
@@ -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];
@@ -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()); }
}
}
}
diff --git a/LibGit2Sharp/BranchUpdater.cs b/LibGit2Sharp/BranchUpdater.cs
index d1a5c39c4..032bf6cf3 100644
--- a/LibGit2Sharp/BranchUpdater.cs
+++ b/LibGit2Sharp/BranchUpdater.cs
@@ -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));
}
}
}
diff --git a/LibGit2Sharp/CheckoutConflictException.cs b/LibGit2Sharp/CheckoutConflictException.cs
index 9bd525ca1..16a5654b2 100644
--- a/LibGit2Sharp/CheckoutConflictException.cs
+++ b/LibGit2Sharp/CheckoutConflictException.cs
@@ -16,8 +16,7 @@ public class CheckoutConflictException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public CheckoutConflictException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -25,8 +24,7 @@ public CheckoutConflictException()
/// A message that describes the error.
public CheckoutConflictException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -35,8 +33,7 @@ public CheckoutConflictException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public CheckoutConflictException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -45,12 +42,10 @@ public CheckoutConflictException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected CheckoutConflictException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal CheckoutConflictException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/CheckoutOptions.cs b/LibGit2Sharp/CheckoutOptions.cs
index 9e297cd47..e95532cb5 100644
--- a/LibGit2Sharp/CheckoutOptions.cs
+++ b/LibGit2Sharp/CheckoutOptions.cs
@@ -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;
}
}
diff --git a/LibGit2Sharp/CherryPickOptions.cs b/LibGit2Sharp/CherryPickOptions.cs
index 14aa04185..065e79bbb 100644
--- a/LibGit2Sharp/CherryPickOptions.cs
+++ b/LibGit2Sharp/CherryPickOptions.cs
@@ -10,8 +10,7 @@ public sealed class CherryPickOptions : MergeAndCheckoutOptionsBase
/// By default the cherry pick will be committed if there are no conflicts.
///
public CherryPickOptions()
- {
- }
+ { }
///
/// When cherry picking a merge commit, the parent number to consider as
diff --git a/LibGit2Sharp/CloneOptions.cs b/LibGit2Sharp/CloneOptions.cs
index 6b264e8a4..8d260db74 100644
--- a/LibGit2Sharp/CloneOptions.cs
+++ b/LibGit2Sharp/CloneOptions.cs
@@ -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;
}
}
diff --git a/LibGit2Sharp/Commit.cs b/LibGit2Sharp/Commit.cs
index 6ea9d0608..40429cd05 100644
--- a/LibGit2Sharp/Commit.cs
+++ b/LibGit2Sharp/Commit.cs
@@ -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);
}
}
diff --git a/LibGit2Sharp/CommitFilter.cs b/LibGit2Sharp/CommitFilter.cs
index 5021c1260..114cb4988 100644
--- a/LibGit2Sharp/CommitFilter.cs
+++ b/LibGit2Sharp/CommitFilter.cs
@@ -73,12 +73,12 @@ private static IList
- GIT_BLAME_FIRST_PARENT = (1<<4),
+ GIT_BLAME_FIRST_PARENT = (1 << 4),
}
[StructLayout(LayoutKind.Sequential)]
@@ -79,8 +79,9 @@ public static GitBlameOptionFlags ToGitBlameOptionFlags(this BlameStrategy strat
return GitBlameOptionFlags.GIT_BLAME_NORMAL;
default:
- throw new NotSupportedException(
- string.Format(CultureInfo.InvariantCulture, "{0} is not supported at this time", strategy));
+ throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture,
+ "{0} is not supported at this time",
+ strategy));
}
}
}
diff --git a/LibGit2Sharp/Core/GitCheckoutOptsWrapper.cs b/LibGit2Sharp/Core/GitCheckoutOptsWrapper.cs
index 26614fa94..0fba82754 100644
--- a/LibGit2Sharp/Core/GitCheckoutOptsWrapper.cs
+++ b/LibGit2Sharp/Core/GitCheckoutOptsWrapper.cs
@@ -66,12 +66,15 @@ internal static CheckoutStrategy CheckoutStrategyFromFileConflictStrategy(Checko
case CheckoutFileConflictStrategy.Ours:
flags = CheckoutStrategy.GIT_CHECKOUT_USE_OURS;
break;
+
case CheckoutFileConflictStrategy.Theirs:
flags = CheckoutStrategy.GIT_CHECKOUT_USE_THEIRS;
break;
+
case CheckoutFileConflictStrategy.Merge:
flags = CheckoutStrategy.GIT_CHECKOUT_CONFLICT_STYLE_MERGE;
break;
+
case CheckoutFileConflictStrategy.Diff3:
flags = CheckoutStrategy.GIT_CHECKOUT_CONFLICT_STYLE_DIFF3;
break;
diff --git a/LibGit2Sharp/Core/GitFilter.cs b/LibGit2Sharp/Core/GitFilter.cs
index 1b177a8ec..9074c7716 100644
--- a/LibGit2Sharp/Core/GitFilter.cs
+++ b/LibGit2Sharp/Core/GitFilter.cs
@@ -70,7 +70,10 @@ internal class GitFilter
/// callback to free the payload.
///
public delegate int git_filter_check_fn(
- GitFilter gitFilter, IntPtr payload, IntPtr filterSource, IntPtr attributeValues);
+ GitFilter gitFilter,
+ IntPtr payload,
+ IntPtr filterSource,
+ IntPtr attributeValues);
///
/// Callback to actually perform the data filtering
@@ -83,10 +86,18 @@ public delegate int git_filter_check_fn(
/// The `payload` value will refer to any payload that was set by the `check` callback. It may be read from or written to as needed.
///
public delegate int git_filter_apply_fn(
- GitFilter gitFilter, IntPtr payload, IntPtr gitBufTo, IntPtr gitBufFrom, IntPtr filterSource);
+ GitFilter gitFilter,
+ IntPtr payload,
+ IntPtr gitBufTo,
+ IntPtr gitBufFrom,
+ IntPtr filterSource);
public delegate int git_filter_stream_fn(
- out IntPtr git_writestream_out, GitFilter self, IntPtr payload, IntPtr filterSource, IntPtr git_writestream_next);
+ out IntPtr git_writestream_out,
+ GitFilter self,
+ IntPtr payload,
+ IntPtr filterSource,
+ IntPtr git_writestream_next);
///
/// Callback to clean up after filtering has been applied. Specified as `filter.cleanup`, this is an optional callback invoked
diff --git a/LibGit2Sharp/Core/GitObjectLazyGroup.cs b/LibGit2Sharp/Core/GitObjectLazyGroup.cs
index 7d4429166..824cc92cc 100644
--- a/LibGit2Sharp/Core/GitObjectLazyGroup.cs
+++ b/LibGit2Sharp/Core/GitObjectLazyGroup.cs
@@ -26,7 +26,9 @@ public static ILazy Singleton(Repository repo, ObjectId id, Fu
return Singleton(() =>
{
using (var osw = new ObjectSafeWrapper(id, repo.Handle))
+ {
return resultSelector(osw.ObjectPtr);
+ }
});
}
}
diff --git a/LibGit2Sharp/Core/GitObjectType.cs b/LibGit2Sharp/Core/GitObjectType.cs
index a38523f2c..50d8412c2 100644
--- a/LibGit2Sharp/Core/GitObjectType.cs
+++ b/LibGit2Sharp/Core/GitObjectType.cs
@@ -75,8 +75,9 @@ public static TreeEntryTargetType ToTreeEntryTargetType(this GitObjectType type)
return TreeEntryTargetType.Blob;
default:
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "Cannot map {0} to a TreeEntryTargetType.", type));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Cannot map {0} to a TreeEntryTargetType.",
+ type));
}
}
@@ -97,8 +98,9 @@ public static ObjectType ToObjectType(this GitObjectType type)
return ObjectType.Tag;
default:
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "Cannot map {0} to a ObjectType.", type));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Cannot map {0} to a ObjectType.",
+ type));
}
}
}
diff --git a/LibGit2Sharp/Core/GitOdbBackendStream.cs b/LibGit2Sharp/Core/GitOdbBackendStream.cs
index f7eec27d5..30477ecbd 100644
--- a/LibGit2Sharp/Core/GitOdbBackendStream.cs
+++ b/LibGit2Sharp/Core/GitOdbBackendStream.cs
@@ -48,11 +48,8 @@ public delegate int write_callback(
IntPtr buffer,
UIntPtr len);
- public delegate int finalize_write_callback(
- IntPtr stream,
- ref GitOid oid);
+ public delegate int finalize_write_callback(IntPtr stream, ref GitOid oid);
- public delegate void free_callback(
- IntPtr stream);
+ public delegate void free_callback(IntPtr stream);
}
}
diff --git a/LibGit2Sharp/Core/GitRepositoryInitOptions.cs b/LibGit2Sharp/Core/GitRepositoryInitOptions.cs
index c42bc83f4..f639a0d8d 100644
--- a/LibGit2Sharp/Core/GitRepositoryInitOptions.cs
+++ b/LibGit2Sharp/Core/GitRepositoryInitOptions.cs
@@ -19,10 +19,10 @@ internal class GitRepositoryInitOptions : IDisposable
public static GitRepositoryInitOptions BuildFrom(FilePath workdirPath, bool isBare)
{
var opts = new GitRepositoryInitOptions
- {
- Flags = GitRepositoryInitFlags.GIT_REPOSITORY_INIT_MKPATH,
- Mode = 0 /* GIT_REPOSITORY_INIT_SHARED_UMASK */
- };
+ {
+ Flags = GitRepositoryInitFlags.GIT_REPOSITORY_INIT_MKPATH,
+ Mode = 0 /* GIT_REPOSITORY_INIT_SHARED_UMASK */
+ };
if (workdirPath != null)
{
diff --git a/LibGit2Sharp/Core/GitRevertOpts.cs b/LibGit2Sharp/Core/GitRevertOpts.cs
index 7976243c2..3d6583a81 100644
--- a/LibGit2Sharp/Core/GitRevertOpts.cs
+++ b/LibGit2Sharp/Core/GitRevertOpts.cs
@@ -12,6 +12,6 @@ internal class GitRevertOpts
public GitMergeOpts MergeOpts = new GitMergeOpts { Version = 1 };
- public GitCheckoutOpts CheckoutOpts = new GitCheckoutOpts {version = 1};
+ public GitCheckoutOpts CheckoutOpts = new GitCheckoutOpts { version = 1 };
}
}
diff --git a/LibGit2Sharp/Core/GitSmartSubtransportStream.cs b/LibGit2Sharp/Core/GitSmartSubtransportStream.cs
index f73218c09..16155aeba 100644
--- a/LibGit2Sharp/Core/GitSmartSubtransportStream.cs
+++ b/LibGit2Sharp/Core/GitSmartSubtransportStream.cs
@@ -36,7 +36,6 @@ public delegate int write_callback(
IntPtr buffer,
UIntPtr len);
- public delegate void free_callback(
- IntPtr stream);
+ public delegate void free_callback(IntPtr stream);
}
}
diff --git a/LibGit2Sharp/Core/GitWriteStream.cs b/LibGit2Sharp/Core/GitWriteStream.cs
index dc1fd622a..6739fd32e 100644
--- a/LibGit2Sharp/Core/GitWriteStream.cs
+++ b/LibGit2Sharp/Core/GitWriteStream.cs
@@ -13,7 +13,7 @@ internal class GitWriteStream
public close_fn close;
[MarshalAs(UnmanagedType.FunctionPtr)]
- public free_fn free;
+ public free_fn free;
public delegate int write_fn(IntPtr stream, IntPtr buffer, UIntPtr len);
public delegate int close_fn(IntPtr stream);
diff --git a/LibGit2Sharp/Core/HistoryRewriter.cs b/LibGit2Sharp/Core/HistoryRewriter.cs
index d313bedbf..de1b24ffa 100644
--- a/LibGit2Sharp/Core/HistoryRewriter.cs
+++ b/LibGit2Sharp/Core/HistoryRewriter.cs
@@ -110,24 +110,33 @@ private Reference RewriteReference(Reference reference)
var sref = reference as SymbolicReference;
if (sref != null)
{
- return RewriteReference(
- sref, old => old.Target, RewriteReference,
- (refs, old, target, logMessage) => refs.UpdateTarget(old, target, logMessage));
+ return RewriteReference(sref,
+ old => old.Target,
+ RewriteReference,
+ (refs, old, target, logMessage) => refs.UpdateTarget(old,
+ target,
+ logMessage));
}
var dref = reference as DirectReference;
if (dref != null)
{
- return RewriteReference(
- dref, old => old.Target, RewriteTarget,
- (refs, old, target, logMessage) => refs.UpdateTarget(old, target.Id, logMessage));
+ return RewriteReference(dref,
+ old => old.Target,
+ RewriteTarget,
+ (refs, old, target, logMessage) => refs.UpdateTarget(old,
+ target.Id,
+ logMessage));
}
return reference;
}
private delegate Reference ReferenceUpdater(
- ReferenceCollection refs, TRef origRef, TTarget origTarget, string logMessage)
+ ReferenceCollection refs,
+ TRef origRef,
+ TTarget origTarget,
+ string logMessage)
where TRef : Reference
where TTarget : class;
@@ -145,7 +154,8 @@ private Reference RewriteReference(
{
newRefName = Reference.TagPrefix +
options.TagNameRewriter(oldRef.CanonicalName.Substring(Reference.TagPrefix.Length),
- false, oldRef.TargetIdentifier);
+ false,
+ oldRef.TargetIdentifier);
}
var newTarget = rewriteTarget(oldRefTarget);
@@ -160,10 +170,10 @@ private Reference RewriteReference(
if (repo.Refs.Resolve(backupName) != null)
{
- throw new InvalidOperationException(
- String.Format(
- CultureInfo.InvariantCulture, "Can't back up reference '{0}' - '{1}' already exists",
- oldRef.CanonicalName, backupName));
+ throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture,
+ "Can't back up reference '{0}' - '{1}' already exists",
+ oldRef.CanonicalName,
+ backupName));
}
repo.Refs.Add(backupName, oldRef.TargetIdentifier, "filter-branch: backup");
@@ -221,8 +231,7 @@ private void RewriteCommit(Commit commit)
// Create the new commit
var mappedNewParents = newParents
- .Select(oldParent =>
- objectMap.ContainsKey(oldParent)
+ .Select(oldParent => objectMap.ContainsKey(oldParent)
? objectMap[oldParent] as Commit
: oldParent)
.Where(newParent => newParent != null)
@@ -293,8 +302,10 @@ private GitObject RewriteTarget(GitObject oldTarget)
newName = options.TagNameRewriter(annotation.Name, true, annotation.Target.Sha);
}
- var newAnnotation = repo.ObjectDatabase.CreateTagAnnotation(newName, newTarget, annotation.Tagger,
- annotation.Message);
+ var newAnnotation = repo.ObjectDatabase.CreateTagAnnotation(newName,
+ newTarget,
+ annotation.Tagger,
+ annotation.Message);
objectMap[annotation] = newAnnotation;
return newAnnotation;
}
@@ -303,8 +314,8 @@ private int ReferenceDepth(Reference reference)
{
var dref = reference as DirectReference;
return dref == null
- ? 1 + ReferenceDepth(((SymbolicReference)reference).Target)
- : 1;
+ ? 1 + ReferenceDepth(((SymbolicReference)reference).Target)
+ : 1;
}
}
}
diff --git a/LibGit2Sharp/Core/LambdaEqualityHelper.cs b/LibGit2Sharp/Core/LambdaEqualityHelper.cs
index 120e705de..80e826c02 100644
--- a/LibGit2Sharp/Core/LambdaEqualityHelper.cs
+++ b/LibGit2Sharp/Core/LambdaEqualityHelper.cs
@@ -48,7 +48,7 @@ public int GetHashCode(T instance)
foreach (Func accessor in equalityContributorAccessors)
{
object item = accessor(instance);
- hashCode = (hashCode*397) ^ (item != null ? item.GetHashCode() : 0);
+ hashCode = (hashCode * 397) ^ (item != null ? item.GetHashCode() : 0);
}
}
diff --git a/LibGit2Sharp/Core/LazyGroup.cs b/LibGit2Sharp/Core/LazyGroup.cs
index da6fed920..d8b13fa42 100644
--- a/LibGit2Sharp/Core/LazyGroup.cs
+++ b/LibGit2Sharp/Core/LazyGroup.cs
@@ -94,8 +94,7 @@ protected class LazyWrapper : Lazy, ILazy
{
public LazyWrapper(Func evaluator)
: base(evaluator)
- {
- }
+ { }
}
}
}
diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs
index 2590669bf..e637a0eb2 100644
--- a/LibGit2Sharp/Core/NativeMethods.cs
+++ b/LibGit2Sharp/Core/NativeMethods.cs
@@ -249,7 +249,7 @@ internal static extern int git_commit_create_from_ids(
[MarshalAs(UnmanagedType.LPArray)] [In] IntPtr[] parents);
[DllImport(libgit2)]
- [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
+ [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
internal static extern string git_commit_message(GitObjectSafeHandle commit);
[DllImport(libgit2)]
@@ -277,7 +277,7 @@ internal static extern int git_config_delete_entry(
[DllImport(libgit2)]
internal static extern int git_config_delete_multivar(
ConfigurationSafeHandle cfg,
- [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string name,
+ [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string regexp);
[DllImport(libgit2)]
@@ -401,8 +401,8 @@ internal delegate int git_cred_acquire_cb(
[DllImport(libgit2)]
internal static extern int git_cred_userpass_plaintext_new(
out IntPtr cred,
- [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string username,
- [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string password);
+ [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string username,
+ [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string password);
[DllImport(libgit2)]
internal static extern int git_describe_commit(
@@ -538,7 +538,7 @@ internal static extern int git_graph_descendant_of(
[DllImport(libgit2)]
internal static extern int git_ignore_add_rule(
RepositorySafeHandle repo,
- [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string rules);
+ [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string rules);
[DllImport(libgit2)]
internal static extern int git_ignore_clear_internal_rules(RepositorySafeHandle repo);
@@ -953,7 +953,7 @@ internal static extern int git_reference_symbolic_set_target(
[DllImport(libgit2)]
internal static extern int git_reference_ensure_log(
RepositorySafeHandle repo,
- [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof (StrictUtf8Marshaler))] string refname);
+ [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string refname);
[DllImport(libgit2)]
internal static extern void git_reflog_free(
diff --git a/LibGit2Sharp/Core/PathCase.cs b/LibGit2Sharp/Core/PathCase.cs
index a5fadbb48..600f693de 100644
--- a/LibGit2Sharp/Core/PathCase.cs
+++ b/LibGit2Sharp/Core/PathCase.cs
@@ -16,6 +16,7 @@ public PathCase(IRepository repo)
comparer = StringComparer.OrdinalIgnoreCase;
comparison = StringComparison.OrdinalIgnoreCase;
break;
+
default:
comparer = StringComparer.Ordinal;
comparison = StringComparison.Ordinal;
diff --git a/LibGit2Sharp/Core/Platform.cs b/LibGit2Sharp/Core/Platform.cs
index debdc73ae..d18613d29 100644
--- a/LibGit2Sharp/Core/Platform.cs
+++ b/LibGit2Sharp/Core/Platform.cs
@@ -13,10 +13,7 @@ internal static class Platform
{
public static string ProcessorArchitecture
{
- get
- {
- return Environment.Is64BitProcess ? "amd64" : "x86";
- }
+ get { return Environment.Is64BitProcess ? "amd64" : "x86"; }
}
public static OperatingSystemType OperatingSystem
@@ -29,8 +26,10 @@ public static OperatingSystemType OperatingSystem
case 4:
case 128:
return OperatingSystemType.Unix;
+
case 6:
return OperatingSystemType.MacOSX;
+
default:
return OperatingSystemType.Windows;
}
diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs
index c18c3bfec..5c91f3926 100644
--- a/LibGit2Sharp/Core/Proxy.cs
+++ b/LibGit2Sharp/Core/Proxy.cs
@@ -172,7 +172,7 @@ public static UnmanagedMemoryStream git_blob_rawcontent_stream(RepositorySafeHan
return new RawContentStream(handle, NativeMethods.git_blob_rawcontent, h => size);
}
- public static Int64 git_blob_rawsize(GitObjectSafeHandle obj)
+ public static long git_blob_rawsize(GitObjectSafeHandle obj)
{
return NativeMethods.git_blob_rawsize(obj);
}
@@ -210,21 +210,19 @@ public static void git_branch_delete(ReferenceSafeHandle reference)
public static IEnumerable git_branch_iterator(Repository repo, GitBranchType branchType)
{
- return git_iterator(
- (out BranchIteratorSafeHandle iter_out) =>
- NativeMethods.git_branch_iterator_new(out iter_out, repo.Handle, branchType),
- (BranchIteratorSafeHandle iter, out ReferenceSafeHandle ref_out, out int res) =>
- {
- GitBranchType type_out;
- res = NativeMethods.git_branch_next(out ref_out, out type_out, iter);
- return new { BranchType = type_out };
- },
- (handle, payload) =>
- {
- var reference = Reference.BuildFromPtr(handle, repo);
- return new Branch(repo, reference, reference.CanonicalName);
- }
- );
+ return git_iterator((out BranchIteratorSafeHandle iter_out) =>
+ NativeMethods.git_branch_iterator_new(out iter_out, repo.Handle, branchType),
+ (BranchIteratorSafeHandle iter, out ReferenceSafeHandle ref_out, out int res) =>
+ {
+ GitBranchType type_out;
+ res = NativeMethods.git_branch_next(out ref_out, out type_out, iter);
+ return new { BranchType = type_out };
+ },
+ (handle, payload) =>
+ {
+ var reference = Reference.BuildFromPtr(handle, repo);
+ return new Branch(repo, reference, reference.CanonicalName);
+ });
}
public static void git_branch_iterator_free(IntPtr iter)
@@ -361,10 +359,16 @@ public static ObjectId git_commit_create(
var treeOid = tree.Id.Oid;
- int res = NativeMethods.git_commit_create_from_ids(
- out commitOid, repo, referenceName, authorHandle,
- committerHandle, null, message,
- ref treeOid, (UIntPtr)parentPtrs.Count, parentPtrs.ToArray());
+ int res = NativeMethods.git_commit_create_from_ids(out commitOid,
+ repo,
+ referenceName,
+ authorHandle,
+ committerHandle,
+ null,
+ message,
+ ref treeOid,
+ (UIntPtr)parentPtrs.Count,
+ parentPtrs.ToArray());
Ensure.ZeroResult(res);
@@ -502,8 +506,8 @@ public static ConfigurationEntry git_config_get_entry(ConfigurationSafeHan
}
return new ConfigurationEntry(LaxUtf8Marshaler.FromNative(entry.namePtr),
- (T)configurationParser[typeof(T)](LaxUtf8Marshaler.FromNative(entry.valuePtr)),
- (ConfigurationLevel)entry.level);
+ (T)configurationParser[typeof(T)](LaxUtf8Marshaler.FromNative(entry.valuePtr)),
+ (ConfigurationLevel)entry.level);
}
public static ConfigurationSafeHandle git_config_new()
@@ -593,19 +597,18 @@ public static IEnumerable> git_config_iterator_glob(
string regexp,
Func> resultSelector)
{
- return git_iterator(
- (out ConfigurationIteratorSafeHandle iter) =>
- NativeMethods.git_config_iterator_glob_new(out iter, config, regexp),
- (ConfigurationIteratorSafeHandle iter, out SafeHandleBase handle, out int res) =>
- {
- handle = null;
+ return git_iterator((out ConfigurationIteratorSafeHandle iter) =>
+ NativeMethods.git_config_iterator_glob_new(out iter, config, regexp),
+ (ConfigurationIteratorSafeHandle iter, out SafeHandleBase handle, out int res) =>
+ {
+ handle = null;
- IntPtr entry;
- res = NativeMethods.git_config_next(out entry, iter);
- return new { EntryPtr = entry };
- },
- (handle, payload) => resultSelector(payload.EntryPtr)
- );
+ IntPtr entry;
+ res = NativeMethods.git_config_next(out entry, iter);
+ return new { EntryPtr = entry };
+ },
+ (handle, payload) =>
+ resultSelector(payload.EntryPtr));
}
public static void git_config_iterator_free(IntPtr iter)
@@ -631,8 +634,7 @@ public static string git_describe_commit(
ObjectId committishId,
DescribeOptions options)
{
- Ensure.ArgumentPositiveInt32(options.MinimumCommitIdAbbreviatedSize,
- "options.MinimumCommitIdAbbreviatedSize");
+ Ensure.ArgumentPositiveInt32(options.MinimumCommitIdAbbreviatedSize, "options.MinimumCommitIdAbbreviatedSize");
using (var osw = new ObjectSafeWrapper(committishId, repo))
{
@@ -699,9 +701,16 @@ public static void git_diff_blobs(
using (var osw1 = new ObjectSafeWrapper(oldBlob, repo, true))
using (var osw2 = new ObjectSafeWrapper(newBlob, repo, true))
{
- int res = NativeMethods.git_diff_blobs(
- osw1.ObjectPtr, null, osw2.ObjectPtr, null,
- options, fileCallback, null, hunkCallback, lineCallback, IntPtr.Zero);
+ int res = NativeMethods.git_diff_blobs(osw1.ObjectPtr,
+ null,
+ osw2.ObjectPtr,
+ null,
+ options,
+ fileCallback,
+ null,
+ hunkCallback,
+ lineCallback,
+ IntPtr.Zero);
Ensure.ZeroResult(res);
}
@@ -913,8 +922,11 @@ public static Conflict git_index_conflict_get(
{
IndexEntrySafeHandle ancestor, ours, theirs;
- int res = NativeMethods.git_index_conflict_get(
- out ancestor, out ours, out theirs, index, path);
+ int res = NativeMethods.git_index_conflict_get(out ancestor,
+ out ours,
+ out theirs,
+ index,
+ path);
if (res == (int)GitErrorCode.NotFound)
{
@@ -923,10 +935,9 @@ public static Conflict git_index_conflict_get(
Ensure.ZeroResult(res);
- return new Conflict(
- IndexEntry.BuildFromPtr(ancestor),
- IndexEntry.BuildFromPtr(ours),
- IndexEntry.BuildFromPtr(theirs));
+ return new Conflict(IndexEntry.BuildFromPtr(ancestor),
+ IndexEntry.BuildFromPtr(ours),
+ IndexEntry.BuildFromPtr(theirs));
}
public static ConflictIteratorSafeHandle git_index_conflict_iterator_new(IndexSafeHandle index)
@@ -955,10 +966,9 @@ public static Conflict git_index_conflict_next(ConflictIteratorSafeHandle iterat
using (ours)
using (theirs)
{
- return new Conflict(
- IndexEntry.BuildFromPtr(ancestor),
- IndexEntry.BuildFromPtr(ours),
- IndexEntry.BuildFromPtr(theirs));
+ return new Conflict(IndexEntry.BuildFromPtr(ancestor),
+ IndexEntry.BuildFromPtr(ours),
+ IndexEntry.BuildFromPtr(theirs));
}
}
@@ -1183,12 +1193,11 @@ public static void git_merge(RepositorySafeHandle repo, GitAnnotatedCommitHandle
{
IntPtr[] their_heads = heads.Select(head => head.DangerousGetHandle()).ToArray();
- int res = NativeMethods.git_merge(
- repo,
- their_heads,
- (UIntPtr)their_heads.Length,
- ref mergeOptions,
- ref checkoutOptions);
+ int res = NativeMethods.git_merge(repo,
+ their_heads,
+ (UIntPtr)their_heads.Length,
+ ref mergeOptions,
+ ref checkoutOptions);
Ensure.ZeroResult(res);
}
@@ -1201,12 +1210,11 @@ public static void git_merge_analysis(
{
IntPtr[] their_heads = heads.Select(head => head.DangerousGetHandle()).ToArray();
- int res = NativeMethods.git_merge_analysis(
- out analysis_out,
- out preference_out,
- repo,
- their_heads,
- their_heads.Length);
+ int res = NativeMethods.git_merge_analysis(out analysis_out,
+ out preference_out,
+ repo,
+ their_heads,
+ their_heads.Length);
Ensure.ZeroResult(res);
}
@@ -1281,8 +1289,10 @@ public static string git_note_default_ref(RepositorySafeHandle repo)
public static ICollection git_note_foreach(RepositorySafeHandle repo, string notes_ref, Func resultSelector)
{
- return git_foreach(resultSelector, c => NativeMethods.git_note_foreach(repo, notes_ref,
- (ref GitOid x, ref GitOid y, IntPtr p) => c(x, y, p), IntPtr.Zero));
+ return git_foreach(resultSelector, c => NativeMethods.git_note_foreach(repo,
+ notes_ref,
+ (ref GitOid x, ref GitOid y, IntPtr p) => c(x, y, p),
+ IntPtr.Zero));
}
public static void git_note_free(IntPtr note)
@@ -1424,7 +1434,8 @@ public static IntPtr git_odb_backend_malloc(IntPtr backend, UIntPtr len)
throw new LibGit2SharpException(String.Format(CultureInfo.InvariantCulture,
"Unable to allocate {0} bytes; out of memory",
len),
- GitErrorCode.Error, GitErrorCategory.NoMemory);
+ GitErrorCode.Error,
+ GitErrorCategory.NoMemory);
}
return toReturn;
@@ -1456,12 +1467,10 @@ public static ICollection git_odb_foreach(
ObjectDatabaseSafeHandle odb,
Func resultSelector)
{
- return git_foreach(
- resultSelector,
- c => NativeMethods.git_odb_foreach(
- odb,
- (x, p) => c(x, p),
- IntPtr.Zero));
+ return git_foreach(resultSelector,
+ c => NativeMethods.git_odb_foreach(odb,
+ (x, p) => c(x, p),
+ IntPtr.Zero));
}
public static OdbStreamSafeHandle git_odb_open_wstream(ObjectDatabaseSafeHandle odb, long size, GitObjectType type)
@@ -1541,7 +1550,11 @@ public static Tuple git_patch_line_stats(PatchSafeHandle patch)
#region git_reference_
- public static ReferenceSafeHandle git_reference_create(RepositorySafeHandle repo, string name, ObjectId targetId, bool allowOverwrite,
+ public static ReferenceSafeHandle git_reference_create(
+ RepositorySafeHandle repo,
+ string name,
+ ObjectId targetId,
+ bool allowOverwrite,
string logMessage)
{
GitOid oid = targetId.Oid;
@@ -1553,7 +1566,11 @@ public static ReferenceSafeHandle git_reference_create(RepositorySafeHandle repo
return handle;
}
- public static ReferenceSafeHandle git_reference_symbolic_create(RepositorySafeHandle repo, string name, string target, bool allowOverwrite,
+ public static ReferenceSafeHandle git_reference_symbolic_create(
+ RepositorySafeHandle repo,
+ string name,
+ string target,
+ bool allowOverwrite,
string logMessage)
{
ReferenceSafeHandle handle;
@@ -1633,7 +1650,10 @@ public static ObjectId git_reference_target(ReferenceSafeHandle reference)
return NativeMethods.git_reference_target(reference).MarshalAsObjectId();
}
- public static ReferenceSafeHandle git_reference_rename(ReferenceSafeHandle reference, string newName, bool allowOverwrite,
+ public static ReferenceSafeHandle git_reference_rename(
+ ReferenceSafeHandle reference,
+ string newName,
+ bool allowOverwrite,
string logMessage)
{
ReferenceSafeHandle ref_out;
@@ -2026,16 +2046,14 @@ public static void git_remote_rename(RepositorySafeHandle repo, string name, str
try
{
- int res = NativeMethods.git_remote_rename(
- ref array.Array,
- repo,
- name,
- new_name);
+ int res = NativeMethods.git_remote_rename(ref array.Array,
+ repo,
+ name,
+ new_name);
if (res == (int)GitErrorCode.NotFound)
{
- throw new NotFoundException(
- string.Format("Remote '{0}' does not exist and cannot be renamed.", name));
+ throw new NotFoundException(string.Format("Remote '{0}' does not exist and cannot be renamed.", name));
}
Ensure.ZeroResult(res);
@@ -2084,13 +2102,12 @@ public static ICollection git_repository_fetchhead_foreach(
RepositorySafeHandle repo,
Func resultSelector)
{
- return git_foreach(
- resultSelector,
- c => NativeMethods.git_repository_fetchhead_foreach(
- repo,
- (IntPtr w, IntPtr x, ref GitOid y, bool z, IntPtr p)
- => c(LaxUtf8Marshaler.FromNative(w), LaxUtf8Marshaler.FromNative(x), y, z, p), IntPtr.Zero),
- GitErrorCode.NotFound);
+ return git_foreach(resultSelector,
+ c => NativeMethods.git_repository_fetchhead_foreach(repo,
+ (IntPtr w, IntPtr x, ref GitOid y, bool z, IntPtr p)
+ => c(LaxUtf8Marshaler.FromNative(w), LaxUtf8Marshaler.FromNative(x), y, z, p),
+ IntPtr.Zero),
+ GitErrorCode.NotFound);
}
public static void git_repository_free(IntPtr repo)
@@ -2147,11 +2164,10 @@ public static ICollection git_repository_mergehead_foreach(
RepositorySafeHandle repo,
Func resultSelector)
{
- return git_foreach(
- resultSelector,
- c => NativeMethods.git_repository_mergehead_foreach(
- repo, (ref GitOid x, IntPtr p) => c(x, p), IntPtr.Zero),
- GitErrorCode.NotFound);
+ return git_foreach(resultSelector,
+ c => NativeMethods.git_repository_mergehead_foreach(repo,
+ (ref GitOid x, IntPtr p) => c(x, p), IntPtr.Zero),
+ GitErrorCode.NotFound);
}
public static string git_repository_message(RepositorySafeHandle repo)
@@ -2186,7 +2202,8 @@ public static RepositorySafeHandle git_repository_open(string path)
if (res == (int)GitErrorCode.NotFound)
{
throw new RepositoryNotFoundException(String.Format(CultureInfo.InvariantCulture,
- "Path '{0}' doesn't point at a valid Git repository or workdir.", path));
+ "Path '{0}' doesn't point at a valid Git repository or workdir.",
+ path));
}
Ensure.ZeroResult(res);
@@ -2216,7 +2233,8 @@ public static void git_repository_open_ext(string path, RepositoryOpenFlags flag
if (res == (int)GitErrorCode.NotFound)
{
throw new RepositoryNotFoundException(String.Format(CultureInfo.InvariantCulture,
- "Path '{0}' doesn't point at a valid Git repository or workdir.", path));
+ "Path '{0}' doesn't point at a valid Git repository or workdir.",
+ path));
}
Ensure.ZeroResult(res);
@@ -2482,11 +2500,12 @@ public static ICollection git_stash_foreach(
RepositorySafeHandle repo,
Func resultSelector)
{
- return git_foreach(
- resultSelector,
- c => NativeMethods.git_stash_foreach(
- repo, (UIntPtr i, IntPtr m, ref GitOid x, IntPtr p) => c((int)i, m, x, p), IntPtr.Zero),
- GitErrorCode.NotFound);
+ return git_foreach(resultSelector,
+ c => NativeMethods.git_stash_foreach(repo,
+ (UIntPtr i, IntPtr m, ref GitOid x, IntPtr p)
+ => c((int)i, m, x, p),
+ IntPtr.Zero),
+ GitErrorCode.NotFound);
}
public static void git_stash_drop(RepositorySafeHandle repo, int index)
@@ -2544,7 +2563,8 @@ public static FileStatus git_status_file(RepositorySafeHandle repo, FilePath pat
case (int)GitErrorCode.Ambiguous:
throw new AmbiguousSpecificationException(CultureInfo.InvariantCulture,
"More than one file matches the pathspec '{0}'. " +
- "You can either force a literal path evaluation (GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH), or use git_status_foreach().",
+ "You can either force a literal path evaluation " +
+ "(GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH), or use git_status_foreach().",
path);
default:
diff --git a/LibGit2Sharp/Core/RawContentStream.cs b/LibGit2Sharp/Core/RawContentStream.cs
index d02fe8b81..566eb5851 100644
--- a/LibGit2Sharp/Core/RawContentStream.cs
+++ b/LibGit2Sharp/Core/RawContentStream.cs
@@ -64,5 +64,5 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
Dispose(handle, linkedResources);
}
- }
+ }
}
diff --git a/LibGit2Sharp/Core/SubmoduleLazyGroup.cs b/LibGit2Sharp/Core/SubmoduleLazyGroup.cs
index 0591574d4..10df34a41 100644
--- a/LibGit2Sharp/Core/SubmoduleLazyGroup.cs
+++ b/LibGit2Sharp/Core/SubmoduleLazyGroup.cs
@@ -15,11 +15,13 @@ public SubmoduleLazyGroup(Repository repo, string name)
protected override void EvaluateInternal(Action evaluator)
{
- repo.Submodules.Lookup(name, handle =>
- {
- evaluator(handle);
- return default(object);
- }, true);
+ repo.Submodules.Lookup(name,
+ handle =>
+ {
+ evaluator(handle);
+ return default(object);
+ },
+ true);
}
}
}
diff --git a/LibGit2Sharp/Core/TarWriter.cs b/LibGit2Sharp/Core/TarWriter.cs
index 9f71db44a..ea2368438 100644
--- a/LibGit2Sharp/Core/TarWriter.cs
+++ b/LibGit2Sharp/Core/TarWriter.cs
@@ -75,8 +75,21 @@ public void Write(
WriteExtendedHeader(fileNameExtendedHeader, linkExtendedHeader, entrySha, modificationTime);
// Note: in case of links, we won't add a content, but the size in the header will still be != 0. It seems strange, but it seem to be what git.git is doing?
- WriteHeader(fileNameExtendedHeader.Name, fileNameExtendedHeader.Prefix, modificationTime, (data != null) ? data.Length : 0, mode,
- userId, groupId, typeflag, linkExtendedHeader.Link, userName, groupName, deviceMajorNumber, deviceMinorNumber);
+ WriteHeader(fileNameExtendedHeader.Name,
+ fileNameExtendedHeader.Prefix,
+ modificationTime,
+ (data != null)
+ ? data.Length
+ : 0,
+ mode,
+ userId,
+ groupId,
+ typeflag,
+ linkExtendedHeader.Link,
+ userName,
+ groupName,
+ deviceMajorNumber,
+ deviceMinorNumber);
// folders have no data, and so do links
if (data != null && !isLink)
@@ -94,7 +107,9 @@ protected static void WriteContent(long count, Stream data, Stream dest)
{
int bytesRead = data.Read(buffer, 0, buffer.Length);
if (bytesRead < 0)
+ {
throw new IOException("TarWriter unable to read from provided stream");
+ }
dest.Write(buffer, 0, bytesRead);
count -= bytesRead;
@@ -103,7 +118,10 @@ protected static void WriteContent(long count, Stream data, Stream dest)
{
int bytesRead = data.Read(buffer, 0, (int)count);
if (bytesRead < 0)
+ {
throw new IOException("TarWriter unable to read from provided stream");
+ }
+
if (bytesRead == 0)
{
while (count > 0)
@@ -113,7 +131,9 @@ protected static void WriteContent(long count, Stream data, Stream dest)
}
}
else
+ {
dest.Write(buffer, 0, bytesRead);
+ }
}
}
@@ -143,8 +163,19 @@ protected void WriteHeader(
string deviceMajorNumber,
string deviceMinorNumber)
{
- var tarHeader = new UsTarHeader(fileName, namePrefix, lastModificationTime, count, mode,
- userId, groupId, typeflag, link, userName, groupName, deviceMajorNumber, deviceMinorNumber);
+ var tarHeader = new UsTarHeader(fileName,
+ namePrefix,
+ lastModificationTime,
+ count,
+ mode,
+ userId,
+ groupId,
+ typeflag,
+ link,
+ userName,
+ groupName,
+ deviceMajorNumber,
+ deviceMinorNumber);
var header = tarHeader.GetHeaderValue();
OutStream.Write(header, 0, header.Length);
}
@@ -168,7 +199,10 @@ private static LinkExtendedHeader ParseLink(bool isLink, Stream data, string ent
if (data.Length > 100)
{
return new LinkExtendedHeader(link,
- string.Format(CultureInfo.InvariantCulture, "see %s.paxheader{0}", entrySha), true);
+ string.Format(CultureInfo.InvariantCulture,
+ "see %s.paxheader{0}",
+ entrySha),
+ true);
}
return new LinkExtendedHeader(link, link, false);
@@ -198,8 +232,20 @@ private void WriteExtendedHeader(FileNameExtendedHeader fileNameExtendedHeader,
using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(extHeader)))
{
- Write(string.Format(CultureInfo.InvariantCulture, "{0}.paxheader", entrySha), stream, modificationTime, "666".OctalToInt32(),
- "0", "0", 'x', "root", "root", "0", "0", entrySha, false);
+ Write(string.Format(CultureInfo.InvariantCulture,
+ "{0}.paxheader",
+ entrySha),
+ stream, modificationTime,
+ "666".OctalToInt32(),
+ "0",
+ "0",
+ 'x',
+ "root",
+ "root",
+ "0",
+ "0",
+ entrySha,
+ false);
}
}
@@ -208,7 +254,9 @@ private static string BuildKeyValueExtHeader(string key, string value)
// "%u %s=%s\n"
int len = key.Length + value.Length + 3;
for (int i = len; i > 9; i /= 10)
+ {
len++;
+ }
return string.Format(CultureInfo.InvariantCulture, "{0} {1}={2}\n", len, key, value);
}
@@ -410,8 +458,12 @@ public static FileNameExtendedHeader Parse(string posixPath, string entrySha)
return new FileNameExtendedHeader(posixPath, posixPath.Substring(0, position), posixPath.Substring(position, posixPath.Length - position), false);
}
- return new FileNameExtendedHeader(posixPath, string.Empty,
- string.Format(CultureInfo.InvariantCulture, "{0}.data", entrySha), true);
+ return new FileNameExtendedHeader(posixPath,
+ string.Empty,
+ string.Format(CultureInfo.InvariantCulture,
+ "{0}.data",
+ entrySha),
+ true);
}
return new FileNameExtendedHeader(posixPath, string.Empty, posixPath, false);
diff --git a/LibGit2Sharp/Core/Utf8Marshaler.cs b/LibGit2Sharp/Core/Utf8Marshaler.cs
index 0080bc4c0..17ee637f5 100644
--- a/LibGit2Sharp/Core/Utf8Marshaler.cs
+++ b/LibGit2Sharp/Core/Utf8Marshaler.cs
@@ -27,8 +27,7 @@ internal class LaxUtf8NoCleanupMarshaler : LaxUtf8Marshaler
#region ICustomMarshaler
public override void CleanUpNativeData(IntPtr pNativeData)
- {
- }
+ { }
#endregion
}
@@ -70,8 +69,9 @@ public static ICustomMarshaler GetInstance(String cookie)
public override Object MarshalNativeToManaged(IntPtr pNativeData)
{
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "{0} cannot be used to retrieve data from libgit2.", GetType().Name));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "{0} cannot be used to retrieve data from libgit2.",
+ GetType().Name));
}
#endregion
@@ -105,8 +105,9 @@ public static ICustomMarshaler GetInstance(String cookie)
public override IntPtr MarshalManagedToNative(object managedObj)
{
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "{0} cannot be used to pass data to libgit2.", GetType().Name));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "{0} cannot be used to pass data to libgit2.",
+ GetType().Name));
}
#endregion
diff --git a/LibGit2Sharp/Core/WriteStream.cs b/LibGit2Sharp/Core/WriteStream.cs
index 37db8af8c..4b7fb03ca 100644
--- a/LibGit2Sharp/Core/WriteStream.cs
+++ b/LibGit2Sharp/Core/WriteStream.cs
@@ -29,8 +29,7 @@ public override long Position
public override long Length { get { throw new InvalidOperationException(); } }
public override void Flush()
- {
- }
+ { }
public override void SetLength(long value)
{
diff --git a/LibGit2Sharp/DetachedHead.cs b/LibGit2Sharp/DetachedHead.cs
index 094d9d263..d934db2c4 100644
--- a/LibGit2Sharp/DetachedHead.cs
+++ b/LibGit2Sharp/DetachedHead.cs
@@ -4,8 +4,7 @@ internal class DetachedHead : Branch
{
internal DetachedHead(Repository repo, Reference reference)
: base(repo, reference, "(no branch)")
- {
- }
+ { }
protected override string Shorten()
{
diff --git a/LibGit2Sharp/Diff.cs b/LibGit2Sharp/Diff.cs
index 911e2425e..d8e8830c2 100644
--- a/LibGit2Sharp/Diff.cs
+++ b/LibGit2Sharp/Diff.cs
@@ -210,7 +210,7 @@ public virtual T Compare(Tree oldTree, Tree newTree, IEnumerable path
{
Func builder;
- if (!ChangesBuilders.TryGetValue(typeof (T), out builder))
+ if (!ChangesBuilders.TryGetValue(typeof(T), out builder))
{
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Unexpected type '{0}' passed to Compare. Supported values are either '{1}' or '{2}'.",
@@ -228,15 +228,13 @@ public virtual T Compare(Tree oldTree, Tree newTree, IEnumerable path
{
diffOptions |= DiffModifiers.DisablePathspecMatch;
- if (explicitPathsOptions.ShouldFailOnUnmatchedPath ||
- explicitPathsOptions.OnUnmatchedPath != null)
+ if (explicitPathsOptions.ShouldFailOnUnmatchedPath || explicitPathsOptions.OnUnmatchedPath != null)
{
diffOptions |= DiffModifiers.IncludeUnmodified;
}
}
- using (DiffSafeHandle diff = BuildDiffList(oldTreeId, newTreeId, comparer,
- diffOptions, paths, explicitPathsOptions, compareOptions))
+ using (DiffSafeHandle diff = BuildDiffList(oldTreeId, newTreeId, comparer, diffOptions, paths, explicitPathsOptions, compareOptions))
{
return (T)builder(diff);
}
@@ -323,7 +321,7 @@ public virtual T Compare(Tree oldTree, DiffTargets diffTargets, IEnumerable builder;
- if (!ChangesBuilders.TryGetValue(typeof (T), out builder))
+ if (!ChangesBuilders.TryGetValue(typeof(T), out builder))
{
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Unexpected type '{0}' passed to Compare. Supported values are either '{1}' or '{2}'.",
@@ -343,15 +341,13 @@ public virtual T Compare(Tree oldTree, DiffTargets diffTargets, IEnumerable(IEnumerable paths, bool includeUntracked) wh
/// Can be either a if you are only interested in the list of files modified, added, ..., or
/// a if you want the actual patch content for the whole diff and for individual files.
/// A containing the changes between the working directory and the index.
- public virtual T Compare(IEnumerable paths, bool includeUntracked,
- ExplicitPathsOptions explicitPathsOptions) where T : class
+ public virtual T Compare(IEnumerable paths, bool includeUntracked, ExplicitPathsOptions explicitPathsOptions) where T : class
{
return Compare(includeUntracked ? DiffModifiers.IncludeUntracked : DiffModifiers.None, paths, explicitPathsOptions);
}
@@ -444,18 +439,24 @@ public virtual T Compare(IEnumerable paths, bool includeUntracked,
/// Can be either a if you are only interested in the list of files modified, added, ..., or
/// a if you want the actual patch content for the whole diff and for individual files.
/// A containing the changes between the working directory and the index.
- public virtual T Compare(IEnumerable paths, bool includeUntracked, ExplicitPathsOptions explicitPathsOptions,
+ public virtual T Compare(
+ IEnumerable paths,
+ bool includeUntracked,
+ ExplicitPathsOptions explicitPathsOptions,
CompareOptions compareOptions) where T : class
{
return Compare(includeUntracked ? DiffModifiers.IncludeUntracked : DiffModifiers.None, paths, explicitPathsOptions, compareOptions);
}
- internal virtual T Compare(DiffModifiers diffOptions, IEnumerable paths = null,
- ExplicitPathsOptions explicitPathsOptions = null, CompareOptions compareOptions = null) where T : class
+ internal virtual T Compare(
+ DiffModifiers diffOptions,
+ IEnumerable paths = null,
+ ExplicitPathsOptions explicitPathsOptions = null,
+ CompareOptions compareOptions = null) where T : class
{
Func builder;
- if (!ChangesBuilders.TryGetValue(typeof (T), out builder))
+ if (!ChangesBuilders.TryGetValue(typeof(T), out builder))
{
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Unexpected type '{0}' passed to Compare. Supported values are either '{1}' or '{2}'.",
@@ -470,15 +471,13 @@ internal virtual T Compare(DiffModifiers diffOptions, IEnumerable pat
{
diffOptions |= DiffModifiers.DisablePathspecMatch;
- if (explicitPathsOptions.ShouldFailOnUnmatchedPath ||
- explicitPathsOptions.OnUnmatchedPath != null)
+ if (explicitPathsOptions.ShouldFailOnUnmatchedPath || explicitPathsOptions.OnUnmatchedPath != null)
{
diffOptions |= DiffModifiers.IncludeUnmodified;
}
}
- using (DiffSafeHandle diff = BuildDiffList(null, null, comparer,
- diffOptions, paths, explicitPathsOptions, compareOptions))
+ using (DiffSafeHandle diff = BuildDiffList(null, null, comparer, diffOptions, paths, explicitPathsOptions, compareOptions))
{
return (T)builder(diff);
}
@@ -523,8 +522,13 @@ private static TreeComparisonHandleRetriever IndexToTree(Repository repo)
return (oh, nh, o) => Proxy.git_diff_tree_to_index(repo.Handle, repo.Index.Handle, oh, o);
}
- private DiffSafeHandle BuildDiffList(ObjectId oldTreeId, ObjectId newTreeId, TreeComparisonHandleRetriever comparisonHandleRetriever,
- DiffModifiers diffOptions, IEnumerable paths, ExplicitPathsOptions explicitPathsOptions,
+ private DiffSafeHandle BuildDiffList(
+ ObjectId oldTreeId,
+ ObjectId newTreeId,
+ TreeComparisonHandleRetriever comparisonHandleRetriever,
+ DiffModifiers diffOptions,
+ IEnumerable paths,
+ ExplicitPathsOptions explicitPathsOptions,
CompareOptions compareOptions)
{
var matchedPaths = new MatchedPathsAggregator();
@@ -556,8 +560,7 @@ private DiffSafeHandle BuildDiffList(ObjectId oldTreeId, ObjectId newTreeId, Tre
private static void DetectRenames(DiffSafeHandle diffList, CompareOptions compareOptions)
{
var similarityOptions = (compareOptions == null) ? null : compareOptions.Similarity;
- if (similarityOptions == null ||
- similarityOptions.RenameDetectionMode == RenameDetectionMode.Default)
+ if (similarityOptions == null || similarityOptions.RenameDetectionMode == RenameDetectionMode.Default)
{
Proxy.git_diff_find_similar(diffList, null);
return;
@@ -620,9 +623,10 @@ private static void DetectRenames(DiffSafeHandle diffList, CompareOptions compar
Proxy.git_diff_find_similar(diffList, opts);
}
- private static void DispatchUnmatchedPaths(ExplicitPathsOptions explicitPathsOptions,
- IEnumerable filePaths,
- IEnumerable matchedPaths)
+ private static void DispatchUnmatchedPaths(
+ ExplicitPathsOptions explicitPathsOptions,
+ IEnumerable filePaths,
+ IEnumerable matchedPaths)
{
List unmatchedPaths = (filePaths != null ?
filePaths.Except(matchedPaths) : Enumerable.Empty()).ToList();
diff --git a/LibGit2Sharp/EmptyCommitException.cs b/LibGit2Sharp/EmptyCommitException.cs
index aa54a5f3c..88d43ed87 100644
--- a/LibGit2Sharp/EmptyCommitException.cs
+++ b/LibGit2Sharp/EmptyCommitException.cs
@@ -14,8 +14,7 @@ public class EmptyCommitException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public EmptyCommitException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public EmptyCommitException()
/// A message that describes the error.
public EmptyCommitException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public EmptyCommitException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public EmptyCommitException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,7 +40,6 @@ public EmptyCommitException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected EmptyCommitException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/EntryExistsException.cs b/LibGit2Sharp/EntryExistsException.cs
index 9dff4d750..117cf4d8f 100644
--- a/LibGit2Sharp/EntryExistsException.cs
+++ b/LibGit2Sharp/EntryExistsException.cs
@@ -14,8 +14,7 @@ public class EntryExistsException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public EntryExistsException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public EntryExistsException()
/// A message that describes the error.
public EntryExistsException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public EntryExistsException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public EntryExistsException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,12 +40,10 @@ public EntryExistsException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected EntryExistsException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal EntryExistsException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/FetchHead.cs b/LibGit2Sharp/FetchHead.cs
index 75f12ae01..456abedc2 100644
--- a/LibGit2Sharp/FetchHead.cs
+++ b/LibGit2Sharp/FetchHead.cs
@@ -15,11 +15,20 @@ internal class FetchHead : ReferenceWrapper
protected FetchHead()
{ }
- internal FetchHead(Repository repo, string remoteCanonicalName,
- string url, ObjectId targetId, bool forMerge, int index)
- : base(repo, new DirectReference(
- string.Format(CultureInfo.InvariantCulture, "FETCH_HEAD[{0}]", index),
- repo, targetId), r => r.CanonicalName)
+ internal FetchHead(
+ Repository repo,
+ string remoteCanonicalName,
+ string url,
+ ObjectId targetId,
+ bool forMerge,
+ int index)
+ : base(repo,
+ new DirectReference(string.Format(CultureInfo.InvariantCulture,
+ "FETCH_HEAD[{0}]",
+ index),
+ repo,
+ targetId),
+ r => r.CanonicalName)
{
Url = url;
ForMerge = forMerge;
diff --git a/LibGit2Sharp/FetchOptionsBase.cs b/LibGit2Sharp/FetchOptionsBase.cs
index 7ad3673e0..483286668 100644
--- a/LibGit2Sharp/FetchOptionsBase.cs
+++ b/LibGit2Sharp/FetchOptionsBase.cs
@@ -8,8 +8,7 @@ namespace LibGit2Sharp
public abstract class FetchOptionsBase
{
internal FetchOptionsBase()
- {
- }
+ { }
///
/// Handler for network transfer and indexing progress information.
diff --git a/LibGit2Sharp/FilteringOptions.cs b/LibGit2Sharp/FilteringOptions.cs
index f06d5a2a4..22988e62e 100644
--- a/LibGit2Sharp/FilteringOptions.cs
+++ b/LibGit2Sharp/FilteringOptions.cs
@@ -22,6 +22,6 @@ public FilteringOptions(string hintPath)
/// The path to "hint" to the filters will be used to apply
/// attributes.
///
- public string HintPath { get; private set; }
+ public string HintPath { get; private set; }
}
}
diff --git a/LibGit2Sharp/FollowFilter.cs b/LibGit2Sharp/FollowFilter.cs
index 7bd607082..22681ed18 100644
--- a/LibGit2Sharp/FollowFilter.cs
+++ b/LibGit2Sharp/FollowFilter.cs
@@ -45,9 +45,8 @@ public CommitSortStrategies SortBy
{
if (!AllowedSortStrategies.Contains(value))
{
- throw new ArgumentException(
- "Unsupported sort strategy. Only 'Topological', 'Time', or 'Topological | Time' are allowed.",
- "value");
+ throw new ArgumentException("Unsupported sort strategy. Only 'Topological', 'Time', or 'Topological | Time' are allowed.",
+ "value");
}
_sortBy = value;
diff --git a/LibGit2Sharp/GitLink.cs b/LibGit2Sharp/GitLink.cs
index 398ab3217..f03b1d719 100644
--- a/LibGit2Sharp/GitLink.cs
+++ b/LibGit2Sharp/GitLink.cs
@@ -16,8 +16,7 @@ protected GitLink()
internal GitLink(Repository repo, ObjectId id)
: base(repo, id)
- {
- }
+ { }
private string DebuggerDisplay
{
diff --git a/LibGit2Sharp/GitObject.cs b/LibGit2Sharp/GitObject.cs
index 9dbce189b..fcad84da2 100644
--- a/LibGit2Sharp/GitObject.cs
+++ b/LibGit2Sharp/GitObject.cs
@@ -15,12 +15,12 @@ public abstract class GitObject : IEquatable, IBelongToARepository
{
internal static IDictionary TypeToKindMap =
new Dictionary
- {
- { typeof(Commit), ObjectType.Commit },
- { typeof(Tree), ObjectType.Tree },
- { typeof(Blob), ObjectType.Blob },
- { typeof(TagAnnotation), ObjectType.Tag },
- };
+ {
+ { typeof(Commit), ObjectType.Commit },
+ { typeof(Tree), ObjectType.Tree },
+ { typeof(Blob), ObjectType.Blob },
+ { typeof(TagAnnotation), ObjectType.Tag },
+ };
private static readonly LambdaEqualityHelper equalityHelper =
new LambdaEqualityHelper(x => x.Id);
@@ -66,12 +66,16 @@ internal static GitObject BuildFrom(Repository repo, ObjectId id, GitObjectType
{
case GitObjectType.Commit:
return new Commit(repo, id);
+
case GitObjectType.Tree:
return new Tree(repo, id, path);
+
case GitObjectType.Tag:
return new TagAnnotation(repo, id);
+
case GitObjectType.Blob:
return new Blob(repo, id);
+
default:
throw new LibGit2SharpException(CultureInfo.InvariantCulture,
"Unexpected type '{0}' for object '{1}'.",
diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs
index d312b3a43..c9ca51096 100644
--- a/LibGit2Sharp/GlobalSettings.cs
+++ b/LibGit2Sharp/GlobalSettings.cs
@@ -61,10 +61,9 @@ public static SmartSubtransportRegistration RegisterSmartSubtransport(stri
try
{
- Proxy.git_transport_register(
- registration.Scheme,
- registration.FunctionPointer,
- registration.RegistrationPointer);
+ Proxy.git_transport_register(registration.Scheme,
+ registration.FunctionPointer,
+ registration.RegistrationPointer);
}
catch (Exception)
{
diff --git a/LibGit2Sharp/HistoryDivergence.cs b/LibGit2Sharp/HistoryDivergence.cs
index 7c54b6bec..262c09c15 100644
--- a/LibGit2Sharp/HistoryDivergence.cs
+++ b/LibGit2Sharp/HistoryDivergence.cs
@@ -64,10 +64,7 @@ internal HistoryDivergence(Repository repo, Commit one, Commit another)
///
public virtual Commit CommonAncestor
{
- get
- {
- return commonAncestor.Value;
- }
+ get { return commonAncestor.Value; }
}
}
diff --git a/LibGit2Sharp/IRepository.cs b/LibGit2Sharp/IRepository.cs
index 391cce1e1..d57f54e25 100644
--- a/LibGit2Sharp/IRepository.cs
+++ b/LibGit2Sharp/IRepository.cs
@@ -52,7 +52,7 @@ public interface IRepository : IDisposable
///
/// Provides access to diffing functionalities to show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees, or changes between two files on disk.
///
- Diff Diff {get;}
+ Diff Diff { get; }
///
/// Gets the database.
diff --git a/LibGit2Sharp/Index.cs b/LibGit2Sharp/Index.cs
index 36dd60b7b..f63c91d7c 100644
--- a/LibGit2Sharp/Index.cs
+++ b/LibGit2Sharp/Index.cs
@@ -245,17 +245,17 @@ internal void Replace(TreeChanges changes)
continue;
case ChangeKind.Deleted:
- /* Fall through */
case ChangeKind.Modified:
- AddEntryToTheIndex(
- treeEntryChanges.OldPath,
- treeEntryChanges.OldOid,
- treeEntryChanges.OldMode);
-
+ AddEntryToTheIndex(treeEntryChanges.OldPath,
+ treeEntryChanges.OldOid,
+ treeEntryChanges.OldMode);
continue;
default:
- throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Entry '{0}' bears an unexpected ChangeKind '{1}'", treeEntryChanges.Path, treeEntryChanges.Status));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Entry '{0}' bears an unexpected ChangeKind '{1}'",
+ treeEntryChanges.Path,
+ treeEntryChanges.Status));
}
}
@@ -267,10 +267,7 @@ internal void Replace(TreeChanges changes)
///
public virtual ConflictCollection Conflicts
{
- get
- {
- return conflicts;
- }
+ get { return conflicts; }
}
private void AddEntryToTheIndex(string path, ObjectId id, Mode mode)
@@ -290,8 +287,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", Count);
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", Count);
}
}
diff --git a/LibGit2Sharp/IndexEntry.cs b/LibGit2Sharp/IndexEntry.cs
index 7dc6b0150..b8a39db6a 100644
--- a/LibGit2Sharp/IndexEntry.cs
+++ b/LibGit2Sharp/IndexEntry.cs
@@ -52,13 +52,13 @@ internal static IndexEntry BuildFromPtr(IndexEntrySafeHandle handle)
FilePath path = LaxFilePathMarshaler.FromNative(entry.Path);
return new IndexEntry
- {
- Path = path.Native,
- Id = entry.Id,
- StageLevel = Proxy.git_index_entry_stage(handle),
- Mode = (Mode)entry.Mode,
- AssumeUnchanged = (GitIndexEntry.GIT_IDXENTRY_VALID & entry.Flags) == GitIndexEntry.GIT_IDXENTRY_VALID
- };
+ {
+ Path = path.Native,
+ Id = entry.Id,
+ StageLevel = Proxy.git_index_entry_stage(handle),
+ Mode = (Mode)entry.Mode,
+ AssumeUnchanged = (GitIndexEntry.GIT_IDXENTRY_VALID & entry.Flags) == GitIndexEntry.GIT_IDXENTRY_VALID
+ };
}
///
@@ -117,7 +117,10 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0} ({1}) => \"{2}\"", Path, StageLevel, Id.ToString(7));
+ "{0} ({1}) => \"{2}\"",
+ Path,
+ StageLevel,
+ Id.ToString(7));
}
}
}
diff --git a/LibGit2Sharp/IndexNameEntry.cs b/LibGit2Sharp/IndexNameEntry.cs
index ef6fc50d2..b8153c953 100644
--- a/LibGit2Sharp/IndexNameEntry.cs
+++ b/LibGit2Sharp/IndexNameEntry.cs
@@ -31,12 +31,15 @@ internal static IndexNameEntry BuildFromPtr(IndexNameEntrySafeHandle handle)
GitIndexNameEntry entry = handle.MarshalAsGitIndexNameEntry();
- string ancestor = entry.Ancestor != IntPtr.Zero ?
- LaxFilePathMarshaler.FromNative(entry.Ancestor).Native : null;
- string ours = entry.Ours != IntPtr.Zero ?
- LaxFilePathMarshaler.FromNative(entry.Ours).Native : null;
- string theirs = entry.Theirs != IntPtr.Zero ?
- LaxFilePathMarshaler.FromNative(entry.Theirs).Native : null;
+ string ancestor = entry.Ancestor != IntPtr.Zero
+ ? LaxFilePathMarshaler.FromNative(entry.Ancestor).Native
+ : null;
+ string ours = entry.Ours != IntPtr.Zero
+ ? LaxFilePathMarshaler.FromNative(entry.Ours).Native
+ : null;
+ string theirs = entry.Theirs != IntPtr.Zero
+ ? LaxFilePathMarshaler.FromNative(entry.Theirs).Native
+ : null;
return new IndexNameEntry
{
@@ -117,7 +120,10 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0} {1} {2}", Ancestor, Ours, Theirs);
+ "{0} {1} {2}",
+ Ancestor,
+ Ours,
+ Theirs);
}
}
}
diff --git a/LibGit2Sharp/IndexReucEntry.cs b/LibGit2Sharp/IndexReucEntry.cs
index ffba71e07..788f14be2 100644
--- a/LibGit2Sharp/IndexReucEntry.cs
+++ b/LibGit2Sharp/IndexReucEntry.cs
@@ -15,9 +15,9 @@ public class IndexReucEntry : IEquatable
{
private static readonly LambdaEqualityHelper equalityHelper =
new LambdaEqualityHelper(x => x.Path,
- x => x.AncestorId, x => x.AncestorMode,
- x => x.OurId, x => x.OurMode,
- x => x.TheirId, x => x.TheirMode);
+ x => x.AncestorId, x => x.AncestorMode,
+ x => x.OurId, x => x.OurMode,
+ x => x.TheirId, x => x.TheirMode);
///
/// Needed for mocking purposes.
@@ -145,7 +145,11 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0}: {1} {2} {3}", Path, AncestorId, OurId, TheirId);
+ "{0}: {1} {2} {3}",
+ Path,
+ AncestorId,
+ OurId,
+ TheirId);
}
}
}
diff --git a/LibGit2Sharp/InvalidSpecificationException.cs b/LibGit2Sharp/InvalidSpecificationException.cs
index 7c82a4372..0b71be897 100644
--- a/LibGit2Sharp/InvalidSpecificationException.cs
+++ b/LibGit2Sharp/InvalidSpecificationException.cs
@@ -17,8 +17,7 @@ public class InvalidSpecificationException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public InvalidSpecificationException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -26,8 +25,7 @@ public InvalidSpecificationException()
/// A message that describes the error.
public InvalidSpecificationException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -36,8 +34,7 @@ public InvalidSpecificationException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public InvalidSpecificationException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -46,12 +43,10 @@ public InvalidSpecificationException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected InvalidSpecificationException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal InvalidSpecificationException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/LibGit2SharpException.cs b/LibGit2Sharp/LibGit2SharpException.cs
index d5947b02f..3621b8ccd 100644
--- a/LibGit2Sharp/LibGit2SharpException.cs
+++ b/LibGit2Sharp/LibGit2SharpException.cs
@@ -15,8 +15,7 @@ public class LibGit2SharpException : Exception
/// Initializes a new instance of the class.
///
public LibGit2SharpException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public LibGit2SharpException()
/// A message that describes the error.
public LibGit2SharpException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -34,8 +32,7 @@ public LibGit2SharpException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public LibGit2SharpException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -55,14 +52,12 @@ public LibGit2SharpException(CultureInfo cultureInfo, string format, params obje
/// The that contains contextual information about the source or destination.
protected LibGit2SharpException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal LibGit2SharpException(string message, GitErrorCode code, GitErrorCategory category) : this(message)
{
Data.Add("libgit2.code", (int)code);
Data.Add("libgit2.category", (int)category);
-
}
}
}
diff --git a/LibGit2Sharp/LockedFileException.cs b/LibGit2Sharp/LockedFileException.cs
index a086a7b0b..67abe025b 100644
--- a/LibGit2Sharp/LockedFileException.cs
+++ b/LibGit2Sharp/LockedFileException.cs
@@ -14,8 +14,7 @@ public class LockedFileException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public LockedFileException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public LockedFileException()
/// A message that describes the error.
public LockedFileException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public LockedFileException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public LockedFileException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,12 +40,10 @@ public LockedFileException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected LockedFileException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal LockedFileException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/LogConfiguration.cs b/LibGit2Sharp/LogConfiguration.cs
index 67c974bdf..dd63bf308 100644
--- a/LibGit2Sharp/LogConfiguration.cs
+++ b/LibGit2Sharp/LogConfiguration.cs
@@ -33,8 +33,7 @@ public LogConfiguration(LogLevel level, LogHandler handler)
}
private LogConfiguration()
- {
- }
+ { }
internal LogLevel Level { get; private set; }
internal LogHandler Handler { get; private set; }
diff --git a/LibGit2Sharp/MergeConflictException.cs b/LibGit2Sharp/MergeConflictException.cs
index 0d8689195..c1eab05be 100644
--- a/LibGit2Sharp/MergeConflictException.cs
+++ b/LibGit2Sharp/MergeConflictException.cs
@@ -10,6 +10,5 @@ namespace LibGit2Sharp
[Serializable]
[Obsolete("This type will be removed in the next release. Please use CheckoutConflictException instead.")]
public class MergeConflictException : CheckoutConflictException
- {
- }
+ { }
}
diff --git a/LibGit2Sharp/MergeFetchHeadNotFoundException.cs b/LibGit2Sharp/MergeFetchHeadNotFoundException.cs
index 26c3844a6..913b79ea2 100644
--- a/LibGit2Sharp/MergeFetchHeadNotFoundException.cs
+++ b/LibGit2Sharp/MergeFetchHeadNotFoundException.cs
@@ -13,8 +13,7 @@ public class MergeFetchHeadNotFoundException : NotFoundException
/// Initializes a new instance of the class.
///
public MergeFetchHeadNotFoundException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -22,8 +21,7 @@ public MergeFetchHeadNotFoundException()
/// A message that describes the error.
public MergeFetchHeadNotFoundException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -32,8 +30,7 @@ public MergeFetchHeadNotFoundException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public MergeFetchHeadNotFoundException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -42,7 +39,6 @@ public MergeFetchHeadNotFoundException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected MergeFetchHeadNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/MergeHead.cs b/LibGit2Sharp/MergeHead.cs
index 2ad508179..b548b254a 100644
--- a/LibGit2Sharp/MergeHead.cs
+++ b/LibGit2Sharp/MergeHead.cs
@@ -15,8 +15,7 @@ protected MergeHead()
internal MergeHead(Repository repo, ObjectId targetId, int index)
: base(repo, new DirectReference(string.Format(CultureInfo.InvariantCulture, "MERGE_HEAD[{0}]", index), repo, targetId), r => r.CanonicalName)
- {
- }
+ { }
///
/// Gets the that this merge head points to.
diff --git a/LibGit2Sharp/MergeOptions.cs b/LibGit2Sharp/MergeOptions.cs
index 535d9a919..c36e6ddca 100644
--- a/LibGit2Sharp/MergeOptions.cs
+++ b/LibGit2Sharp/MergeOptions.cs
@@ -17,8 +17,7 @@ public sealed class MergeOptions : MergeAndCheckoutOptionsBase
///
///
public MergeOptions()
- {
- }
+ { }
///
/// The type of merge to perform.
diff --git a/LibGit2Sharp/MergeTreeOptions.cs b/LibGit2Sharp/MergeTreeOptions.cs
index 910ec95f7..a9eea97eb 100644
--- a/LibGit2Sharp/MergeTreeOptions.cs
+++ b/LibGit2Sharp/MergeTreeOptions.cs
@@ -13,7 +13,6 @@ public sealed class MergeTreeOptions : MergeOptionsBase
///
///
public MergeTreeOptions()
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/MergeTreeResult.cs b/LibGit2Sharp/MergeTreeResult.cs
index 2f54d9565..c871c6278 100644
--- a/LibGit2Sharp/MergeTreeResult.cs
+++ b/LibGit2Sharp/MergeTreeResult.cs
@@ -29,31 +29,19 @@ internal MergeTreeResult(Tree tree)
///
/// The status of the merge.
///
- public virtual MergeTreeStatus Status
- {
- get;
- private set;
- }
+ public virtual MergeTreeStatus Status { get; private set; }
///
/// The resulting tree of the merge.
/// This will return null
if the merge has been unsuccessful due to conflicts.
///
- public virtual Tree Tree
- {
- get;
- private set;
- }
+ public virtual Tree Tree { get; private set; }
///
/// The resulting conflicts from the merge.
/// This will return null
if the merge was successful and there were no conflicts.
///
- public virtual IEnumerable Conflicts
- {
- get;
- private set;
- }
+ public virtual IEnumerable Conflicts { get; private set; }
}
///
diff --git a/LibGit2Sharp/NameConflictException.cs b/LibGit2Sharp/NameConflictException.cs
index 16d1bf091..ddd56156b 100644
--- a/LibGit2Sharp/NameConflictException.cs
+++ b/LibGit2Sharp/NameConflictException.cs
@@ -14,8 +14,7 @@ public class NameConflictException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public NameConflictException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public NameConflictException()
/// A message that describes the error.
public NameConflictException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public NameConflictException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public NameConflictException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,12 +40,10 @@ public NameConflictException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected NameConflictException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal NameConflictException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/Network.cs b/LibGit2Sharp/Network.cs
index 189cd778a..55f773f40 100644
--- a/LibGit2Sharp/Network.cs
+++ b/LibGit2Sharp/Network.cs
@@ -152,11 +152,12 @@ static RemoteSafeHandle BuildRemoteSafeHandle(RepositorySafeHandle repoHandle, s
return remoteHandle;
}
- static void DoFetch(RepositorySafeHandle repoHandle,
- Remote remote,
- FetchOptions options,
- string logMessage,
- IEnumerable refspecs)
+ static void DoFetch(
+ RepositorySafeHandle repoHandle,
+ Remote remote,
+ FetchOptions options,
+ string logMessage,
+ IEnumerable refspecs)
{
using (RemoteSafeHandle remoteHandle = BuildRemoteSafeHandle(repoHandle, remote))
{
@@ -164,11 +165,12 @@ static void DoFetch(RepositorySafeHandle repoHandle,
}
}
- static void DoFetch(RepositorySafeHandle repoHandle,
- string url,
- FetchOptions options,
- string logMessage,
- IEnumerable refspecs)
+ static void DoFetch(
+ RepositorySafeHandle repoHandle,
+ string url,
+ FetchOptions options,
+ string logMessage,
+ IEnumerable refspecs)
{
using (RemoteSafeHandle remoteHandle = BuildRemoteSafeHandle(repoHandle, url))
{
@@ -301,9 +303,7 @@ public virtual void Fetch(Remote remote, IEnumerable refspecs, FetchOpti
///
/// The url to fetch from
/// The list of resfpecs to use
- public virtual void Fetch(
- string url,
- IEnumerable refspecs)
+ public virtual void Fetch(string url, IEnumerable refspecs)
{
Fetch(url, refspecs, null, null);
}
@@ -314,10 +314,7 @@ public virtual void Fetch(
/// The url to fetch from
/// The list of resfpecs to use
/// controlling fetch behavior
- public virtual void Fetch(
- string url,
- IEnumerable refspecs,
- FetchOptions options)
+ public virtual void Fetch(string url, IEnumerable refspecs, FetchOptions options)
{
Fetch(url, refspecs, options, null);
}
@@ -328,10 +325,7 @@ public virtual void Fetch(
/// The url to fetch from
/// The list of resfpecs to use
/// Message to use when updating the reflog.
- public virtual void Fetch(
- string url,
- IEnumerable refspecs,
- string logMessage)
+ public virtual void Fetch(string url, IEnumerable refspecs, string logMessage)
{
Fetch(url, refspecs, null, logMessage);
}
@@ -435,8 +429,11 @@ public virtual void Push(
Ensure.ArgumentNotNull(objectish, "objectish");
Ensure.ArgumentNotNullOrEmptyString(destinationSpec, "destinationSpec");
- Push(remote, string.Format(CultureInfo.InvariantCulture,
- "{0}:{1}", objectish, destinationSpec));
+ Push(remote,
+ string.Format(CultureInfo.InvariantCulture,
+ "{0}:{1}",
+ objectish,
+ destinationSpec));
}
///
@@ -455,8 +452,12 @@ public virtual void Push(
Ensure.ArgumentNotNull(objectish, "objectish");
Ensure.ArgumentNotNullOrEmptyString(destinationSpec, "destinationSpec");
- Push(remote, string.Format(CultureInfo.InvariantCulture,
- "{0}:{1}", objectish, destinationSpec), pushOptions);
+ Push(remote,
+ string.Format(CultureInfo.InvariantCulture,
+ "{0}:{1}",
+ objectish,
+ destinationSpec),
+ pushOptions);
}
///
@@ -464,9 +465,7 @@ public virtual void Push(
///
/// The to push to.
/// The pushRefSpec to push.
- public virtual void Push(
- Remote remote,
- string pushRefSpec)
+ public virtual void Push(Remote remote, string pushRefSpec)
{
Ensure.ArgumentNotNullOrEmptyString(pushRefSpec, "pushRefSpec");
@@ -493,9 +492,7 @@ public virtual void Push(
///
/// The to push to.
/// The pushRefSpecs to push.
- public virtual void Push(
- Remote remote,
- IEnumerable pushRefSpecs)
+ public virtual void Push(Remote remote, IEnumerable pushRefSpecs)
{
Push(remote, pushRefSpecs, null);
}
@@ -506,10 +503,7 @@ public virtual void Push(
/// The to push to.
/// The pushRefSpecs to push.
/// controlling push behavior
- public virtual void Push(
- Remote remote,
- IEnumerable pushRefSpecs,
- PushOptions pushOptions)
+ public virtual void Push(Remote remote, IEnumerable pushRefSpecs, PushOptions pushOptions)
{
Ensure.ArgumentNotNull(remote, "remote");
Ensure.ArgumentNotNull(pushRefSpecs, "pushRefSpecs");
@@ -531,12 +525,13 @@ public virtual void Push(
var callbacks = new RemoteCallbacks(pushOptions);
GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks();
- Proxy.git_remote_push(remoteHandle, pushRefSpecs,
- new GitPushOptions()
- {
- PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism,
- RemoteCallbacks = gitCallbacks,
- });
+ Proxy.git_remote_push(remoteHandle,
+ pushRefSpecs,
+ new GitPushOptions()
+ {
+ PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism,
+ RemoteCallbacks = gitCallbacks,
+ });
}
}
@@ -575,9 +570,10 @@ internal virtual IEnumerable FetchHeads
{
int i = 0;
- return Proxy.git_repository_fetchhead_foreach(
- repository.Handle,
- (name, url, oid, isMerge) => new FetchHead(repository, name, url, oid, isMerge, i++));
+ Func resultSelector =
+ (name, url, oid, isMerge) => new FetchHead(repository, name, url, oid, isMerge, i++);
+
+ return Proxy.git_repository_fetchhead_foreach(repository.Handle, resultSelector);
}
}
}
diff --git a/LibGit2Sharp/NonFastForwardException.cs b/LibGit2Sharp/NonFastForwardException.cs
index 2cf4ccd93..7431058c8 100644
--- a/LibGit2Sharp/NonFastForwardException.cs
+++ b/LibGit2Sharp/NonFastForwardException.cs
@@ -15,8 +15,7 @@ public class NonFastForwardException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public NonFastForwardException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public NonFastForwardException()
/// A message that describes the error.
public NonFastForwardException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -34,8 +32,7 @@ public NonFastForwardException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public NonFastForwardException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -44,12 +41,10 @@ public NonFastForwardException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected NonFastForwardException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal NonFastForwardException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/NotFoundException.cs b/LibGit2Sharp/NotFoundException.cs
index c2a32ed00..4b8c10033 100644
--- a/LibGit2Sharp/NotFoundException.cs
+++ b/LibGit2Sharp/NotFoundException.cs
@@ -14,8 +14,7 @@ public class NotFoundException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public NotFoundException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public NotFoundException()
/// A message that describes the error.
public NotFoundException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public NotFoundException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public NotFoundException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,12 +40,10 @@ public NotFoundException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected NotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal NotFoundException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/Note.cs b/LibGit2Sharp/Note.cs
index 89a4eb65b..0feebb9da 100644
--- a/LibGit2Sharp/Note.cs
+++ b/LibGit2Sharp/Note.cs
@@ -12,6 +12,9 @@ namespace LibGit2Sharp
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Note : IEquatable
{
+ private static readonly LambdaEqualityHelper equalityHelper =
+ new LambdaEqualityHelper(x => x.BlobId, x => x.TargetObjectId, x => x.Namespace);
+
///
/// Needed for mocking purposes.
///
@@ -55,9 +58,6 @@ internal static Note BuildFromPtr(NoteSafeHandle note, string @namespace, Object
return new Note(oid, message, targetObjectId, @namespace);
}
- private static readonly LambdaEqualityHelper equalityHelper =
- new LambdaEqualityHelper(x => x.BlobId, x => x.TargetObjectId, x => x.Namespace);
-
///
/// Determines whether the specified is equal to the current .
///
@@ -114,8 +114,10 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "Target \"{0}\", Namespace \"{1}\": {2}",
- TargetObjectId.ToString(7), Namespace, Message);
+ "Target \"{0}\", Namespace \"{1}\": {2}",
+ TargetObjectId.ToString(7),
+ Namespace,
+ Message);
}
}
}
diff --git a/LibGit2Sharp/NoteCollection.cs b/LibGit2Sharp/NoteCollection.cs
index 8ea0a0fef..7d8c756d2 100644
--- a/LibGit2Sharp/NoteCollection.cs
+++ b/LibGit2Sharp/NoteCollection.cs
@@ -65,10 +65,7 @@ public virtual string DefaultNamespace
///
public virtual IEnumerable Namespaces
{
- get
- {
- return NamespaceRefs.Select(UnCanonicalizeName);
- }
+ get { return NamespaceRefs.Select(UnCanonicalizeName); }
}
internal IEnumerable NamespaceRefs
@@ -108,8 +105,9 @@ public virtual IEnumerable this[string @namespace]
string canonicalNamespace = NormalizeToCanonicalName(@namespace);
- return Proxy.git_note_foreach(repo.Handle, canonicalNamespace,
- (blobId,annotatedObjId) => this[canonicalNamespace, annotatedObjId]);
+ return Proxy.git_note_foreach(repo.Handle,
+ canonicalNamespace,
+ (blobId, annotatedObjId) => this[canonicalNamespace, annotatedObjId]);
}
}
@@ -242,8 +240,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs
index 4f9cfe7d9..d855e2c6f 100644
--- a/LibGit2Sharp/ObjectDatabase.cs
+++ b/LibGit2Sharp/ObjectDatabase.cs
@@ -42,7 +42,7 @@ internal ObjectDatabase(Repository repo)
public virtual IEnumerator GetEnumerator()
{
ICollection oids = Proxy.git_odb_foreach(handle,
- ptr => ptr.MarshalAs());
+ ptr => ptr.MarshalAs());
return oids
.Select(gitOid => repo.Lookup(new ObjectId(gitOid)))
@@ -99,14 +99,14 @@ public virtual Blob CreateBlob(string path)
if (repo.Info.IsBare && !Path.IsPathRooted(path))
{
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture,
- "Cannot create a blob in a bare repository from a relative path ('{0}').", path));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Cannot create a blob in a bare repository from a relative path ('{0}').",
+ path));
}
ObjectId id = Path.IsPathRooted(path)
- ? Proxy.git_blob_create_fromdisk(repo.Handle, path)
- : Proxy.git_blob_create_fromfile(repo.Handle, path);
+ ? Proxy.git_blob_create_fromdisk(repo.Handle, path)
+ : Proxy.git_blob_create_fromfile(repo.Handle, path);
return repo.Lookup(id);
}
@@ -152,7 +152,9 @@ public int Provider(IntPtr content, int max_length, IntPtr data)
if (totalRemainingBytesToRead < max_length)
{
- bytesToRead = totalRemainingBytesToRead > int.MaxValue ? int.MaxValue : (int)totalRemainingBytesToRead;
+ bytesToRead = totalRemainingBytesToRead > int.MaxValue
+ ? int.MaxValue
+ : (int)totalRemainingBytesToRead;
}
}
@@ -163,8 +165,7 @@ public int Provider(IntPtr content, int max_length, IntPtr data)
int numberOfReadBytes = stream.Read(local, 0, bytesToRead);
- if (numberOfBytesToConsume.HasValue
- && numberOfReadBytes == 0)
+ if (numberOfBytesToConsume.HasValue && numberOfReadBytes == 0)
{
return (int)GitErrorCode.User;
}
@@ -251,7 +252,7 @@ public virtual Blob CreateBlob(Stream stream, long numberOfBytesToConsume)
using (var odbStream = Proxy.git_odb_open_wstream(handle, numberOfBytesToConsume, GitObjectType.Blob))
{
- var buffer = new byte[4*1024];
+ var buffer = new byte[4 * 1024];
long totalRead = 0;
while (totalRead < numberOfBytesToConsume)
@@ -488,8 +489,10 @@ public virtual string ShortenObjectId(GitObject gitObject, int minLength)
if (minLength <= 0 || minLength > ObjectId.HexSize)
{
- throw new ArgumentOutOfRangeException("minLength", minLength,
- string.Format("Expected value should be greater than zero and less than or equal to {0}.", ObjectId.HexSize));
+ throw new ArgumentOutOfRangeException("minLength",
+ minLength,
+ string.Format("Expected value should be greater than zero and less than or equal to {0}.",
+ ObjectId.HexSize));
}
string shortSha = Proxy.git_object_short_id(repo.Handle, gitObject.Id);
@@ -571,9 +574,11 @@ public virtual Commit FindMergeBase(IEnumerable commits, MergeBaseFindin
case MergeBaseFindingStrategy.Standard:
id = Proxy.git_merge_base_many(repo.Handle, ids.ToArray());
break;
+
case MergeBaseFindingStrategy.Octopus:
id = Proxy.git_merge_base_octopus(repo.Handle, ids.ToArray());
break;
+
default:
throw new ArgumentException("", "strategy");
}
@@ -602,8 +607,8 @@ public virtual MergeTreeResult MergeCommits(Commit ours, Commit theirs, MergeTre
{
Version = 1,
MergeFileFavorFlags = options.MergeFileFavor,
- MergeTreeFlags = options.FindRenames ? GitMergeTreeFlags.GIT_MERGE_TREE_FIND_RENAMES :
- GitMergeTreeFlags.GIT_MERGE_TREE_NORMAL,
+ MergeTreeFlags = options.FindRenames ? GitMergeTreeFlags.GIT_MERGE_TREE_FIND_RENAMES
+ : GitMergeTreeFlags.GIT_MERGE_TREE_NORMAL,
RenameThreshold = (uint)options.RenameThreshold,
TargetLimit = (uint)options.TargetLimit,
};
diff --git a/LibGit2Sharp/ObjectId.cs b/LibGit2Sharp/ObjectId.cs
index 7b247e8a1..f93817a48 100644
--- a/LibGit2Sharp/ObjectId.cs
+++ b/LibGit2Sharp/ObjectId.cs
@@ -297,9 +297,11 @@ private static bool LooksValid(string objectId, bool throwIfInvalid)
return false;
}
- throw new ArgumentException(
- string.Format(CultureInfo.InvariantCulture, "'{0}' is not a valid object identifier. Its length should be {1}.", objectId, HexSize),
- "objectId");
+ throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
+ "'{0}' is not a valid object identifier. Its length should be {1}.",
+ objectId,
+ HexSize),
+ "objectId");
}
return objectId.All(c => hexDigits.Contains(c.ToString(CultureInfo.InvariantCulture)));
diff --git a/LibGit2Sharp/OdbBackend.cs b/LibGit2Sharp/OdbBackend.cs
index 8ecd3f734..58b5f60b4 100644
--- a/LibGit2Sharp/OdbBackend.cs
+++ b/LibGit2Sharp/OdbBackend.cs
@@ -33,10 +33,7 @@ internal void Free()
///
/// In your subclass, override this member to provide the list of actions your backend supports.
///
- protected abstract OdbBackendOperations SupportedOperations
- {
- get;
- }
+ protected abstract OdbBackendOperations SupportedOperations { get; }
///
/// Call this method from your implementations of Read and ReadPrefix to allocate a buffer in
@@ -64,8 +61,7 @@ protected UnmanagedMemoryStream AllocateAndBuildFrom(byte[] bytes)
/// A Stream for you to write to and then return. Do not dispose this object before returning it.
protected unsafe UnmanagedMemoryStream Allocate(long size)
{
- if (size < 0 ||
- (UIntPtr.Size == sizeof(int) && size > int.MaxValue))
+ if (size < 0 || (UIntPtr.Size == sizeof(int) && size > int.MaxValue))
{
throw new ArgumentOutOfRangeException("size");
}
@@ -330,7 +326,7 @@ private unsafe static int ReadPrefix(
try
{
- var shortSha = ObjectId.ToString(short_oid.Id, (int) len);
+ var shortSha = ObjectId.ToString(short_oid.Id, (int)len);
ObjectId oid;
ObjectType objectType;
@@ -545,7 +541,7 @@ private static int ExistsPrefix(
found_oid.Id = ObjectId.Zero.RawId;
int result = odbBackend.ExistsPrefix(shortSha, out found);
- if (result == (int) GitErrorCode.Ok)
+ if (result == (int)GitErrorCode.Ok)
{
found_oid.Id = found.RawId;
}
@@ -622,7 +618,7 @@ private unsafe int CallbackMethod(ObjectId id)
{
var oid = id.RawId;
- fixed(void* ptr = &oid[0])
+ fixed (void* ptr = &oid[0])
{
return cb(new IntPtr(ptr), data);
}
@@ -639,11 +635,10 @@ internal static long ConverToLong(UIntPtr len)
{
if (len.ToUInt64() > long.MaxValue)
{
- throw new InvalidOperationException(
- string.Format(
- CultureInfo.InvariantCulture,
- "Provided length ({0}) exceeds long.MaxValue ({1}).",
- len.ToUInt64(), long.MaxValue));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Provided length ({0}) exceeds long.MaxValue ({1}).",
+ len.ToUInt64(),
+ long.MaxValue));
}
return (long)len.ToUInt64();
diff --git a/LibGit2Sharp/OdbBackendStream.cs b/LibGit2Sharp/OdbBackendStream.cs
index 6397b7bb3..2889ac20b 100644
--- a/LibGit2Sharp/OdbBackendStream.cs
+++ b/LibGit2Sharp/OdbBackendStream.cs
@@ -45,48 +45,34 @@ protected virtual void Dispose()
///
/// If true, then it is legal to call the Read method.
///
- public abstract bool CanRead
- {
- get;
- }
+ public abstract bool CanRead { get; }
///
/// If true, then it is legal to call the Write and FinalizeWrite methods.
///
- public abstract bool CanWrite
- {
- get;
- }
+ public abstract bool CanWrite { get; }
///
/// Requests that the stream write the next length bytes of the stream to the provided Stream object.
///
- public abstract int Read(
- Stream dataStream,
- long length);
+ public abstract int Read(Stream dataStream, long length);
///
/// Requests that the stream write the first length bytes of the provided Stream object to the stream.
///
- public abstract int Write(
- Stream dataStream,
- long length);
+ public abstract int Write(Stream dataStream, long length);
///
/// After all bytes have been written to the stream, the object ID is provided to FinalizeWrite.
///
- public abstract int FinalizeWrite(
- ObjectId id);
+ public abstract int FinalizeWrite(ObjectId id);
///
/// The backend object this stream was created by.
///
public virtual OdbBackend Backend
{
- get
- {
- return this.backend;
- }
+ get { return this.backend; }
}
private readonly OdbBackend backend;
@@ -138,10 +124,7 @@ private static class BackendStreamEntryPoints
public static readonly GitOdbBackendStream.finalize_write_callback FinalizeWriteCallback = FinalizeWrite;
public static readonly GitOdbBackendStream.free_callback FreeCallback = Free;
- private unsafe static int Read(
- IntPtr stream,
- IntPtr buffer,
- UIntPtr len)
+ private unsafe static int Read(IntPtr stream, IntPtr buffer, UIntPtr len)
{
OdbBackendStream odbBackendStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitOdbBackendStream.GCHandleOffset)).Target as OdbBackendStream;
@@ -165,10 +148,7 @@ private unsafe static int Read(
return (int)GitErrorCode.Error;
}
- private static unsafe int Write(
- IntPtr stream,
- IntPtr buffer,
- UIntPtr len)
+ private static unsafe int Write(IntPtr stream, IntPtr buffer, UIntPtr len)
{
OdbBackendStream odbBackendStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitOdbBackendStream.GCHandleOffset)).Target as OdbBackendStream;
@@ -192,9 +172,7 @@ private static unsafe int Write(
return (int)GitErrorCode.Error;
}
- private static int FinalizeWrite(
- IntPtr stream,
- ref GitOid oid)
+ private static int FinalizeWrite(IntPtr stream, ref GitOid oid)
{
OdbBackendStream odbBackendStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitOdbBackendStream.GCHandleOffset)).Target as OdbBackendStream;
@@ -213,8 +191,7 @@ private static int FinalizeWrite(
return (int)GitErrorCode.Error;
}
- private static void Free(
- IntPtr stream)
+ private static void Free(IntPtr stream)
{
OdbBackendStream odbBackendStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitOdbBackendStream.GCHandleOffset)).Target as OdbBackendStream;
diff --git a/LibGit2Sharp/Patch.cs b/LibGit2Sharp/Patch.cs
index 4bbb884bd..c437f4d31 100644
--- a/LibGit2Sharp/Patch.cs
+++ b/LibGit2Sharp/Patch.cs
@@ -58,7 +58,9 @@ private int PrintCallBack(GitDiffDelta delta, GitDiffHunk hunk, GitDiffLine line
// Deleted files mean no "new file" path
- var pathPtr = delta.NewFile.Path != IntPtr.Zero ? delta.NewFile.Path : delta.OldFile.Path;
+ var pathPtr = delta.NewFile.Path != IntPtr.Zero
+ ? delta.NewFile.Path
+ : delta.OldFile.Path;
var filePath = LaxFilePathMarshaler.FromNative(pathPtr);
PatchEntryChanges currentChange = this[filePath];
@@ -164,7 +166,7 @@ public virtual string Content
///
/// .
/// The patch content as string.
- public static implicit operator string(Patch patch)
+ public static implicit operator string (Patch patch)
{
return patch.fullPatchBuilder.ToString();
}
@@ -174,7 +176,9 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "+{0} -{1}", linesAdded, linesDeleted);
+ "+{0} -{1}",
+ linesAdded,
+ linesDeleted);
}
}
}
diff --git a/LibGit2Sharp/PatchStats.cs b/LibGit2Sharp/PatchStats.cs
index f22eecb1a..da92ac07f 100644
--- a/LibGit2Sharp/PatchStats.cs
+++ b/LibGit2Sharp/PatchStats.cs
@@ -75,7 +75,7 @@ IEnumerator IEnumerable.GetEnumerator()
///
public virtual ContentChangeStats this[string path]
{
- get { return this[(FilePath) path]; }
+ get { return this[(FilePath)path]; }
}
private ContentChangeStats this[FilePath path]
@@ -111,8 +111,10 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture, "+{0} -{1}",
- TotalLinesAdded, TotalLinesDeleted);
+ return string.Format(CultureInfo.InvariantCulture,
+ "+{0} -{1}",
+ TotalLinesAdded,
+ TotalLinesDeleted);
}
}
}
diff --git a/LibGit2Sharp/PeelException.cs b/LibGit2Sharp/PeelException.cs
index e7fbfe796..629b67334 100644
--- a/LibGit2Sharp/PeelException.cs
+++ b/LibGit2Sharp/PeelException.cs
@@ -15,8 +15,7 @@ public class PeelException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public PeelException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public PeelException()
/// A message that describes the error.
public PeelException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -34,8 +32,7 @@ public PeelException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public PeelException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -44,12 +41,10 @@ public PeelException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected PeelException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal PeelException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/PushResult.cs b/LibGit2Sharp/PushResult.cs
index bf85e3ab8..713f13a55 100644
--- a/LibGit2Sharp/PushResult.cs
+++ b/LibGit2Sharp/PushResult.cs
@@ -18,10 +18,7 @@ protected PushResult()
///
public virtual IEnumerable FailedPushUpdates
{
- get
- {
- return failedPushUpdates;
- }
+ get { return failedPushUpdates; }
}
///
@@ -30,10 +27,7 @@ public virtual IEnumerable FailedPushUpdates
///
public virtual bool HasErrors
{
- get
- {
- return failedPushUpdates.Count > 0;
- }
+ get { return failedPushUpdates.Count > 0; }
}
internal PushResult(List failedPushUpdates)
diff --git a/LibGit2Sharp/RecurseSubmodulesException.cs b/LibGit2Sharp/RecurseSubmodulesException.cs
index 586261ddb..c322f7605 100644
--- a/LibGit2Sharp/RecurseSubmodulesException.cs
+++ b/LibGit2Sharp/RecurseSubmodulesException.cs
@@ -14,8 +14,7 @@ public class RecurseSubmodulesException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public RecurseSubmodulesException()
- {
- }
+ { }
///
/// The path to the initial repository the operation was run on.
diff --git a/LibGit2Sharp/RefSpec.cs b/LibGit2Sharp/RefSpec.cs
index d0ac8b3b4..9c811c5f9 100644
--- a/LibGit2Sharp/RefSpec.cs
+++ b/LibGit2Sharp/RefSpec.cs
@@ -67,8 +67,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "{0}", Specification);
+ return string.Format(CultureInfo.InvariantCulture, "{0}", Specification);
}
}
}
diff --git a/LibGit2Sharp/RefSpecCollection.cs b/LibGit2Sharp/RefSpecCollection.cs
index 1b7b5a137..163281a12 100644
--- a/LibGit2Sharp/RefSpecCollection.cs
+++ b/LibGit2Sharp/RefSpecCollection.cs
@@ -68,8 +68,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs
index d75427145..297426501 100644
--- a/LibGit2Sharp/Reference.cs
+++ b/LibGit2Sharp/Reference.cs
@@ -231,7 +231,9 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0} => \"{1}\"", CanonicalName, TargetIdentifier);
+ "{0} => \"{1}\"",
+ CanonicalName,
+ TargetIdentifier);
}
}
diff --git a/LibGit2Sharp/ReferenceCollection.cs b/LibGit2Sharp/ReferenceCollection.cs
index 241b3e119..4d2b9ece2 100644
--- a/LibGit2Sharp/ReferenceCollection.cs
+++ b/LibGit2Sharp/ReferenceCollection.cs
@@ -245,8 +245,11 @@ public virtual SymbolicReference Add(string name, Reference targetRef, string lo
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(targetRef, "targetRef");
- using (ReferenceSafeHandle handle = Proxy.git_reference_symbolic_create(repo.Handle, name, targetRef.CanonicalName,
- allowOverwrite, logMessage))
+ using (ReferenceSafeHandle handle = Proxy.git_reference_symbolic_create(repo.Handle,
+ name,
+ targetRef.CanonicalName,
+ allowOverwrite,
+ logMessage))
{
return (SymbolicReference)Reference.BuildFromPtr(handle, repo);
}
@@ -331,8 +334,13 @@ public virtual Reference Rename(Reference reference, string newName, string logM
if (logMessage == null)
{
- logMessage = string.Format(CultureInfo.InvariantCulture, "{0}: renamed {1} to {2}",
- reference.IsLocalBranch ? "branch" : "reference", reference.CanonicalName, newName);
+ logMessage = string.Format(CultureInfo.InvariantCulture,
+ "{0}: renamed {1} to {2}",
+ reference.IsLocalBranch
+ ? "branch"
+ : "reference",
+ reference.CanonicalName,
+ newName);
}
using (ReferenceSafeHandle referencePtr = RetrieveReferencePtr(reference.CanonicalName))
@@ -433,7 +441,9 @@ internal T Resolve(string name) where T : Reference
using (ReferenceSafeHandle referencePtr = RetrieveReferencePtr(name, false))
{
- return referencePtr == null ? null : Reference.BuildFromPtr(referencePtr, repo);
+ return referencePtr == null
+ ? null
+ : Reference.BuildFromPtr(referencePtr, repo);
}
}
@@ -633,7 +643,8 @@ internal Reference MoveHeadTarget(T target)
else
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
- "'{0}' is not a valid target type.", typeof(T)));
+ "'{0}' is not a valid target type.",
+ typeof(T)));
}
return repo.Refs.Head;
@@ -761,8 +772,7 @@ public virtual IEnumerable ReachableFrom(
///
/// The set of s that are interesting.
/// The list of that can reach at least one within .
- public virtual IEnumerable ReachableFrom(
- IEnumerable targets)
+ public virtual IEnumerable ReachableFrom(IEnumerable targets)
{
return ReachableFrom(this, targets);
}
@@ -771,8 +781,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
diff --git a/LibGit2Sharp/ReferenceWrapper.cs b/LibGit2Sharp/ReferenceWrapper.cs
index e6fa07797..391ff3cc0 100644
--- a/LibGit2Sharp/ReferenceWrapper.cs
+++ b/LibGit2Sharp/ReferenceWrapper.cs
@@ -165,8 +165,10 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0} => \"{1}\"", CanonicalName,
- (TargetObject != null) ? TargetObject.Id.ToString(7) : "?");
+ "{0} => \"{1}\"", CanonicalName,
+ (TargetObject != null)
+ ? TargetObject.Id.ToString(7)
+ : "?");
}
}
diff --git a/LibGit2Sharp/ReflogCollection.cs b/LibGit2Sharp/ReflogCollection.cs
index d2bbb8919..0b2e6e113 100644
--- a/LibGit2Sharp/ReflogCollection.cs
+++ b/LibGit2Sharp/ReflogCollection.cs
@@ -87,8 +87,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/Remote.cs b/LibGit2Sharp/Remote.cs
index efa716a85..137208198 100644
--- a/LibGit2Sharp/Remote.cs
+++ b/LibGit2Sharp/Remote.cs
@@ -59,15 +59,10 @@ internal static Remote BuildFromPtr(RemoteSafeHandle handle, Repository repo)
/// Gets the distinct push url for this remote repository, if set.
/// Defaults to the fetch url () if not set.
///
- public virtual string PushUrl {
- get
- {
- return pushUrl ?? Url;
- }
- private set
- {
- pushUrl = value;
- }
+ public virtual string PushUrl
+ {
+ get { return pushUrl ?? Url; }
+ private set { pushUrl = value; }
}
///
@@ -202,8 +197,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "{0} => {1}", Name, Url);
+ return string.Format(CultureInfo.InvariantCulture, "{0} => {1}", Name, Url);
}
}
diff --git a/LibGit2Sharp/RemoteCallbacks.cs b/LibGit2Sharp/RemoteCallbacks.cs
index 8d8a06a99..6dacf4925 100644
--- a/LibGit2Sharp/RemoteCallbacks.cs
+++ b/LibGit2Sharp/RemoteCallbacks.cs
@@ -253,7 +253,12 @@ private int GitPackbuilderProgressHandler(int stage, uint current, uint total, I
return Proxy.ConvertResultToCancelFlag(shouldContinue);
}
- private int GitCredentialHandler(out IntPtr ptr, IntPtr cUrl, IntPtr usernameFromUrl, GitCredentialType credTypes, IntPtr payload)
+ private int GitCredentialHandler(
+ out IntPtr ptr,
+ IntPtr cUrl,
+ IntPtr usernameFromUrl,
+ GitCredentialType credTypes,
+ IntPtr payload)
{
string url = LaxUtf8Marshaler.FromNative(cUrl);
string username = LaxUtf8Marshaler.FromNative(usernameFromUrl);
diff --git a/LibGit2Sharp/RemoteCollection.cs b/LibGit2Sharp/RemoteCollection.cs
index a85cb6ad6..6ab1a3faf 100644
--- a/LibGit2Sharp/RemoteCollection.cs
+++ b/LibGit2Sharp/RemoteCollection.cs
@@ -170,8 +170,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/RemoteUpdater.cs b/LibGit2Sharp/RemoteUpdater.cs
index 07ef39dbd..cb0e08b3c 100644
--- a/LibGit2Sharp/RemoteUpdater.cs
+++ b/LibGit2Sharp/RemoteUpdater.cs
@@ -75,10 +75,7 @@ private void SetPushRefSpecs(IEnumerable value)
///
public virtual TagFetchMode TagFetchMode
{
- set
- {
- Proxy.git_remote_set_autotag(repo.Handle, remote.Name, value);
- }
+ set { Proxy.git_remote_set_autotag(repo.Handle, remote.Name, value); }
}
///
@@ -86,10 +83,7 @@ public virtual TagFetchMode TagFetchMode
///
public virtual string Url
{
- set
- {
- Proxy.git_remote_set_url(repo.Handle, remote.Name, value);
- }
+ set { Proxy.git_remote_set_url(repo.Handle, remote.Name, value); }
}
///
@@ -97,10 +91,7 @@ public virtual string Url
///
public virtual string PushUrl
{
- set
- {
- Proxy.git_remote_set_pushurl(repo.Handle, remote.Name, value);
- }
+ set { Proxy.git_remote_set_pushurl(repo.Handle, remote.Name, value); }
}
///
diff --git a/LibGit2Sharp/RemoveFromIndexException.cs b/LibGit2Sharp/RemoveFromIndexException.cs
index 9f0863129..a1cea4bb0 100644
--- a/LibGit2Sharp/RemoveFromIndexException.cs
+++ b/LibGit2Sharp/RemoveFromIndexException.cs
@@ -14,8 +14,7 @@ public class RemoveFromIndexException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public RemoveFromIndexException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public RemoveFromIndexException()
/// A message that describes the error.
public RemoveFromIndexException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -44,8 +42,7 @@ public RemoveFromIndexException(CultureInfo cultureInfo, string format, params o
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public RemoveFromIndexException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -54,7 +51,6 @@ public RemoveFromIndexException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected RemoveFromIndexException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/RenameDetails.cs b/LibGit2Sharp/RenameDetails.cs
index 199b7269f..b866aac60 100644
--- a/LibGit2Sharp/RenameDetails.cs
+++ b/LibGit2Sharp/RenameDetails.cs
@@ -110,9 +110,11 @@ private string DebuggerDisplay
{
get
{
- return string.Format(
- CultureInfo.InvariantCulture,
- "{0} -> {1} [{2}%]", OldFilePath, NewFilePath, Similarity);
+ return string.Format(CultureInfo.InvariantCulture,
+ "{0} -> {1} [{2}%]",
+ OldFilePath,
+ NewFilePath,
+ Similarity);
}
}
}
diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs
index d01c36774..0c9b004cb 100644
--- a/LibGit2Sharp/Repository.cs
+++ b/LibGit2Sharp/Repository.cs
@@ -82,8 +82,7 @@ public Repository(string path, RepositoryOptions options)
if (isBare && (isWorkDirNull ^ isIndexNull))
{
- throw new ArgumentException(
- "When overriding the opening of a bare repository, both RepositoryOptions.WorkingDirectoryPath an RepositoryOptions.IndexPath have to be provided.");
+ throw new ArgumentException("When overriding the opening of a bare repository, both RepositoryOptions.WorkingDirectoryPath an RepositoryOptions.IndexPath have to be provided.");
}
if (!isWorkDirNull)
@@ -122,11 +121,11 @@ public Repository(string path, RepositoryOptions options)
tags = new TagCollection(this);
stashes = new StashCollection(this);
info = new Lazy(() => new RepositoryInformation(this, isBare));
- config =
- new Lazy(
- () =>
- RegisterForCleanup(new Configuration(this, null, configurationGlobalFilePath, configurationXDGFilePath,
- configurationSystemFilePath)));
+ config = new Lazy(() => RegisterForCleanup(new Configuration(this,
+ null,
+ configurationGlobalFilePath,
+ configurationXDGFilePath,
+ configurationSystemFilePath)));
odb = new Lazy(() => new ObjectDatabase(this));
diff = new Diff(this);
notes = new NoteCollection(this);
@@ -255,10 +254,7 @@ public Index Index
///
public Ignore Ignore
{
- get
- {
- return ignore;
- }
+ get { return ignore; }
}
///
@@ -266,10 +262,7 @@ public Ignore Ignore
///
public Network Network
{
- get
- {
- return network.Value;
- }
+ get { return network.Value; }
}
///
@@ -277,10 +270,7 @@ public Network Network
///
public ObjectDatabase ObjectDatabase
{
- get
- {
- return odb.Value;
- }
+ get { return odb.Value; }
}
///
@@ -530,8 +520,7 @@ internal GitObject Lookup(string objectish, GitObjectType type, LookUpOptions lo
if (lookUpOptions.HasFlag(LookUpOptions.DereferenceResultToCommit))
{
- return obj.DereferenceToCommit(
- lookUpOptions.HasFlag(LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit));
+ return obj.DereferenceToCommit(lookUpOptions.HasFlag(LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit));
}
return obj;
@@ -539,10 +528,11 @@ internal GitObject Lookup(string objectish, GitObjectType type, LookUpOptions lo
internal Commit LookupCommit(string committish)
{
- return (Commit)Lookup(committish, GitObjectType.Any,
- LookUpOptions.ThrowWhenNoGitObjectHasBeenFound |
- LookUpOptions.DereferenceResultToCommit |
- LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit);
+ return (Commit)Lookup(committish,
+ GitObjectType.Any,
+ LookUpOptions.ThrowWhenNoGitObjectHasBeenFound |
+ LookUpOptions.DereferenceResultToCommit |
+ LookUpOptions.ThrowWhenCanNotBeDereferencedToACommit);
}
///
@@ -657,7 +647,7 @@ public static string Clone(string sourceUrl, string workdirPath,
bool continueOperation = OnRepositoryOperationStarting(options.RepositoryOperationStarting,
context);
- if(!continueOperation)
+ if (!continueOperation)
{
throw new UserCancelledException("Clone cancelled by the user.");
}
@@ -704,10 +694,9 @@ public static string Clone(string sourceUrl, string workdirPath,
}
catch (Exception ex)
{
- throw new RecurseSubmodulesException(
- "The top level repository was cloned, but there was an error cloning its submodules.",
- ex,
- clonedRepoPath);
+ throw new RecurseSubmodulesException("The top level repository was cloned, but there was an error cloning its submodules.",
+ ex,
+ clonedRepoPath);
}
return clonedRepoPath;
@@ -790,8 +779,9 @@ private static void RecursivelyCloneSubmodules(CloneOptions options, string repo
/// The callback to notify change.
/// Context of the repository this operation affects.
/// true to continue the operation, false to cancel.
- private static bool OnRepositoryOperationStarting(RepositoryOperationStarting repositoryChangedCallback,
- RepositoryOperationContext context)
+ private static bool OnRepositoryOperationStarting(
+ RepositoryOperationStarting repositoryChangedCallback,
+ RepositoryOperationContext context)
{
bool continueOperation = true;
if (repositoryChangedCallback != null)
@@ -802,8 +792,9 @@ private static bool OnRepositoryOperationStarting(RepositoryOperationStarting re
return continueOperation;
}
- private static void OnRepositoryOperationCompleted(RepositoryOperationCompleted repositoryChangedCallback,
- RepositoryOperationContext context)
+ private static void OnRepositoryOperationCompleted(
+ RepositoryOperationCompleted repositoryChangedCallback,
+ RepositoryOperationContext context)
{
if (repositoryChangedCallback != null)
{
@@ -858,8 +849,10 @@ public Branch Checkout(string committishOrBranchSpec, CheckoutOptions options)
}
}
- obj = GitObject.BuildFrom(this, Proxy.git_object_id(objH), Proxy.git_object_type(objH),
- PathFromRevparseSpec(committishOrBranchSpec));
+ obj = GitObject.BuildFrom(this,
+ Proxy.git_object_id(objH),
+ Proxy.git_object_type(objH),
+ PathFromRevparseSpec(committishOrBranchSpec));
}
finally
{
@@ -889,7 +882,9 @@ public Branch Checkout(Branch branch, CheckoutOptions options)
// Make sure this is not an unborn branch.
if (branch.Tip == null)
{
- throw new UnbornBranchException(CultureInfo.InvariantCulture, "The tip of branch '{0}' is null. There's nothing to checkout.", branch.FriendlyName);
+ throw new UnbornBranchException(CultureInfo.InvariantCulture,
+ "The tip of branch '{0}' is null. There's nothing to checkout.",
+ branch.FriendlyName);
}
if (!branch.IsRemote && !(branch is DetachedHead) &&
@@ -954,7 +949,7 @@ private void CheckoutTree(
IConvertableToGitCheckoutOpts opts)
{
- using(GitCheckoutOptsWrapper checkoutOptionsWrapper = new GitCheckoutOptsWrapper(opts, ToFilePaths(paths)))
+ using (GitCheckoutOptsWrapper checkoutOptionsWrapper = new GitCheckoutOptsWrapper(opts, ToFilePaths(paths)))
{
var options = checkoutOptionsWrapper.Options;
Proxy.git_checkout_tree(Handle, tree.Id, ref options);
@@ -1117,7 +1112,7 @@ private void UpdateHeadAndTerminalReference(Commit commit, string reflogMessage)
return;
}
- var symRef = (SymbolicReference) reference;
+ var symRef = (SymbolicReference)reference;
reference = symRef.Target;
@@ -1476,7 +1471,7 @@ private MergeResult Merge(GitAnnotatedCommitHandle[] annotatedCommits, Signature
FastForwardStrategy fastForwardStrategy = (options.FastForwardStrategy != FastForwardStrategy.Default) ?
options.FastForwardStrategy : FastForwardStrategyFromMergePreference(mergePreference);
- switch(fastForwardStrategy)
+ switch (fastForwardStrategy)
{
case FastForwardStrategy.Default:
if (mergeAnalysis.HasFlag(GitMergeAnalysis.GIT_MERGE_ANALYSIS_FASTFORWARD))
@@ -1542,16 +1537,15 @@ private MergeResult Merge(GitAnnotatedCommitHandle[] annotatedCommits, Signature
private MergeResult NormalMerge(GitAnnotatedCommitHandle[] annotatedCommits, Signature merger, MergeOptions options)
{
MergeResult mergeResult;
-
var mergeOptions = new GitMergeOpts
- {
- Version = 1,
- MergeFileFavorFlags = options.MergeFileFavor,
- MergeTreeFlags = options.FindRenames ? GitMergeTreeFlags.GIT_MERGE_TREE_FIND_RENAMES :
- GitMergeTreeFlags.GIT_MERGE_TREE_NORMAL,
- RenameThreshold = (uint) options.RenameThreshold,
- TargetLimit = (uint) options.TargetLimit,
- };
+ {
+ Version = 1,
+ MergeFileFavorFlags = options.MergeFileFavor,
+ MergeTreeFlags = options.FindRenames ? GitMergeTreeFlags.GIT_MERGE_TREE_FIND_RENAMES
+ : GitMergeTreeFlags.GIT_MERGE_TREE_NORMAL,
+ RenameThreshold = (uint)options.RenameThreshold,
+ TargetLimit = (uint)options.TargetLimit,
+ };
using (GitCheckoutOptsWrapper checkoutOptionsWrapper = new GitCheckoutOptsWrapper(options))
{
@@ -1588,7 +1582,7 @@ private MergeResult NormalMerge(GitAnnotatedCommitHandle[] annotatedCommits, Sig
private MergeResult FastForwardMerge(GitAnnotatedCommitHandle annotatedCommit, MergeOptions options)
{
ObjectId id = Proxy.git_annotated_commit_id(annotatedCommit);
- Commit fastForwardCommit = (Commit) Lookup(id, ObjectType.Commit);
+ Commit fastForwardCommit = (Commit)Lookup(id, ObjectType.Commit);
Ensure.GitObjectIsNotNull(fastForwardCommit, id.Sha);
CheckoutTree(fastForwardCommit.Tree, null, new FastForwardCheckoutOptionsAdapter(options));
@@ -2092,7 +2086,7 @@ private IEnumerable RemoveStagedItems(IEnumerable paths, bool re
case ChangeKind.Unmodified:
if (removeFromWorkingDirectory && (
status.HasFlag(FileStatus.ModifiedInIndex) ||
- status.HasFlag(FileStatus.NewInIndex) ))
+ status.HasFlag(FileStatus.NewInIndex)))
{
throw new RemoveFromIndexException(CultureInfo.InvariantCulture,
"Unable to remove file '{0}', as it has changes staged in the index. You can call the Remove() method with removeFromWorkingDirectory=false if you want to remove it from the index only.",
diff --git a/LibGit2Sharp/RepositoryExtensions.cs b/LibGit2Sharp/RepositoryExtensions.cs
index 385c5a9a3..9c6446670 100644
--- a/LibGit2Sharp/RepositoryExtensions.cs
+++ b/LibGit2Sharp/RepositoryExtensions.cs
@@ -357,7 +357,8 @@ internal static string BuildRelativePathFrom(this Repository repo, string path)
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
"Unable to process file '{0}'. This file is not located under the working directory of the repository ('{1}').",
- normalizedPath, repo.Info.WorkingDirectory));
+ normalizedPath,
+ repo.Info.WorkingDirectory));
}
return normalizedPath.Substring(repo.Info.WorkingDirectory.Length);
diff --git a/LibGit2Sharp/RepositoryNotFoundException.cs b/LibGit2Sharp/RepositoryNotFoundException.cs
index b07ee913c..10333212a 100644
--- a/LibGit2Sharp/RepositoryNotFoundException.cs
+++ b/LibGit2Sharp/RepositoryNotFoundException.cs
@@ -14,8 +14,7 @@ public class RepositoryNotFoundException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public RepositoryNotFoundException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public RepositoryNotFoundException()
/// A message that describes the error.
public RepositoryNotFoundException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public RepositoryNotFoundException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public RepositoryNotFoundException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,7 +40,6 @@ public RepositoryNotFoundException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected RepositoryNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/RepositoryOperationContext.cs b/LibGit2Sharp/RepositoryOperationContext.cs
index 4eb043301..5b67d7269 100644
--- a/LibGit2Sharp/RepositoryOperationContext.cs
+++ b/LibGit2Sharp/RepositoryOperationContext.cs
@@ -20,8 +20,7 @@ protected RepositoryOperationContext()
/// The URL that this operation will download from.
internal RepositoryOperationContext(string repositoryPath, string remoteUrl)
: this(repositoryPath, remoteUrl, string.Empty, string.Empty, 0)
- {
- }
+ { }
///
/// Constructor suitable for use on the sub repositories.
@@ -31,10 +30,11 @@ internal RepositoryOperationContext(string repositoryPath, string remoteUrl)
/// The path to the super repository.
/// The logical name of this submodule.
/// The depth of this sub repository from the original super repository.
- internal RepositoryOperationContext(string repositoryPath,
- string remoteUrl,
- string parentRepositoryPath,
- string submoduleName, int recursionDepth)
+ internal RepositoryOperationContext(
+ string repositoryPath,
+ string remoteUrl,
+ string parentRepositoryPath,
+ string submoduleName, int recursionDepth)
{
RepositoryPath = repositoryPath;
RemoteUrl = remoteUrl;
diff --git a/LibGit2Sharp/RepositoryStatus.cs b/LibGit2Sharp/RepositoryStatus.cs
index 56a1c8dda..8a6b2e0f6 100644
--- a/LibGit2Sharp/RepositoryStatus.cs
+++ b/LibGit2Sharp/RepositoryStatus.cs
@@ -34,17 +34,17 @@ public class RepositoryStatus : IEnumerable
private static IDictionary> Build()
{
return new Dictionary>
- {
- { FileStatus.NewInWorkdir, (rs, s) => rs.untracked.Add(s) },
- { FileStatus.ModifiedInWorkdir, (rs, s) => rs.modified.Add(s) },
- { FileStatus.DeletedFromWorkdir, (rs, s) => rs.missing.Add(s) },
- { FileStatus.NewInIndex, (rs, s) => rs.added.Add(s) },
- { FileStatus.ModifiedInIndex, (rs, s) => rs.staged.Add(s) },
- { FileStatus.DeletedFromIndex, (rs, s) => rs.removed.Add(s) },
- { FileStatus.RenamedInIndex, (rs, s) => rs.renamedInIndex.Add(s) },
- { FileStatus.Ignored, (rs, s) => rs.ignored.Add(s) },
- { FileStatus.RenamedInWorkdir, (rs, s) => rs.renamedInWorkDir.Add(s) },
- };
+ {
+ { FileStatus.NewInWorkdir, (rs, s) => rs.untracked.Add(s) },
+ { FileStatus.ModifiedInWorkdir, (rs, s) => rs.modified.Add(s) },
+ { FileStatus.DeletedFromWorkdir, (rs, s) => rs.missing.Add(s) },
+ { FileStatus.NewInIndex, (rs, s) => rs.added.Add(s) },
+ { FileStatus.ModifiedInIndex, (rs, s) => rs.staged.Add(s) },
+ { FileStatus.DeletedFromIndex, (rs, s) => rs.removed.Add(s) },
+ { FileStatus.RenamedInIndex, (rs, s) => rs.renamedInIndex.Add(s) },
+ { FileStatus.Ignored, (rs, s) => rs.ignored.Add(s) },
+ { FileStatus.RenamedInWorkdir, (rs, s) => rs.renamedInWorkDir.Add(s) },
+ };
}
///
@@ -151,23 +151,23 @@ private void AddStatusEntryForDelta(FileStatus gitStatus, GitDiffDelta deltaHead
if ((gitStatus & FileStatus.RenamedInIndex) == FileStatus.RenamedInIndex)
{
- headToIndexRenameDetails = new RenameDetails(
- LaxFilePathMarshaler.FromNative(deltaHeadToIndex.OldFile.Path).Native,
- LaxFilePathMarshaler.FromNative(deltaHeadToIndex.NewFile.Path).Native,
- (int)deltaHeadToIndex.Similarity);
+ headToIndexRenameDetails =
+ new RenameDetails(LaxFilePathMarshaler.FromNative(deltaHeadToIndex.OldFile.Path).Native,
+ LaxFilePathMarshaler.FromNative(deltaHeadToIndex.NewFile.Path).Native,
+ (int)deltaHeadToIndex.Similarity);
}
if ((gitStatus & FileStatus.RenamedInWorkdir) == FileStatus.RenamedInWorkdir)
{
- indexToWorkDirRenameDetails = new RenameDetails(
- LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.OldFile.Path).Native,
- LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.NewFile.Path).Native,
- (int)deltaIndexToWorkDir.Similarity);
+ indexToWorkDirRenameDetails =
+ new RenameDetails(LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.OldFile.Path).Native,
+ LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.NewFile.Path).Native,
+ (int)deltaIndexToWorkDir.Similarity);
}
- var filePath = (deltaIndexToWorkDir != null) ?
- LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.NewFile.Path).Native :
- LaxFilePathMarshaler.FromNative(deltaHeadToIndex.NewFile.Path).Native;
+ var filePath = (deltaIndexToWorkDir != null)
+ ? LaxFilePathMarshaler.FromNative(deltaIndexToWorkDir.NewFile.Path).Native
+ : LaxFilePathMarshaler.FromNative(deltaHeadToIndex.NewFile.Path).Native;
StatusEntry statusEntry = new StatusEntry(filePath, gitStatus, headToIndexRenameDetails, indexToWorkDirRenameDetails);
@@ -323,12 +323,15 @@ private string DebuggerDisplay
{
get
{
- return string.Format(
- CultureInfo.InvariantCulture,
- "+{0} ~{1} -{2} | +{3} ~{4} -{5} | i{6}",
- Added.Count(), Staged.Count(), Removed.Count(),
- Untracked.Count(), Modified.Count(), Missing.Count(),
- Ignored.Count());
+ return string.Format(CultureInfo.InvariantCulture,
+ "+{0} ~{1} -{2} | +{3} ~{4} -{5} | i{6}",
+ Added.Count(),
+ Staged.Count(),
+ Removed.Count(),
+ Untracked.Count(),
+ Modified.Count(),
+ Missing.Count(),
+ Ignored.Count());
}
}
}
diff --git a/LibGit2Sharp/RevertOptions.cs b/LibGit2Sharp/RevertOptions.cs
index c57794f01..882afb082 100644
--- a/LibGit2Sharp/RevertOptions.cs
+++ b/LibGit2Sharp/RevertOptions.cs
@@ -10,8 +10,7 @@ public sealed class RevertOptions : MergeAndCheckoutOptionsBase
/// By default the revert will be committed if there are no conflicts.
///
public RevertOptions()
- {
- }
+ { }
///
/// When reverting a merge commit, the parent number to consider as
diff --git a/LibGit2Sharp/SmartSubtransport.cs b/LibGit2Sharp/SmartSubtransport.cs
index 1203cedf7..f7d2d7556 100644
--- a/LibGit2Sharp/SmartSubtransport.cs
+++ b/LibGit2Sharp/SmartSubtransport.cs
@@ -60,8 +60,7 @@ public abstract class SmartSubtransport
/// Override this method to add additional cleanup steps to your subclass. Be sure to call base.Close().
///
protected virtual void Close()
- {
- }
+ { }
///
/// Invoked by libgit2 when this subtransport is being freed. Override this method to add additional
diff --git a/LibGit2Sharp/SmartSubtransportRegistration.cs b/LibGit2Sharp/SmartSubtransportRegistration.cs
index 8247b023c..8fa403d37 100644
--- a/LibGit2Sharp/SmartSubtransportRegistration.cs
+++ b/LibGit2Sharp/SmartSubtransportRegistration.cs
@@ -27,23 +27,11 @@ internal SmartSubtransportRegistration(string scheme)
///
/// The URI scheme (eg "http") for this transport.
///
- public string Scheme
- {
- get;
- private set;
- }
+ public string Scheme { get; private set; }
- internal IntPtr RegistrationPointer
- {
- get;
- private set;
- }
+ internal IntPtr RegistrationPointer { get; private set; }
- internal IntPtr FunctionPointer
- {
- get;
- private set;
- }
+ internal IntPtr FunctionPointer { get; private set; }
private IntPtr CreateRegistrationPointer()
{
diff --git a/LibGit2Sharp/SmartSubtransportStream.cs b/LibGit2Sharp/SmartSubtransportStream.cs
index 7048370ea..b5cb21c02 100644
--- a/LibGit2Sharp/SmartSubtransportStream.cs
+++ b/LibGit2Sharp/SmartSubtransportStream.cs
@@ -46,27 +46,19 @@ protected virtual void Free()
///
/// Requests that the stream write the next length bytes of the stream to the provided Stream object.
///
- public abstract int Read(
- Stream dataStream,
- long length,
- out long bytesRead);
+ public abstract int Read(Stream dataStream, long length, out long bytesRead);
///
/// Requests that the stream write the first length bytes of the provided Stream object to the stream.
///
- public abstract int Write(
- Stream dataStream,
- long length);
+ public abstract int Write(Stream dataStream, long length);
///
/// The smart transport that this stream represents a connection over.
///
public virtual SmartSubtransport SmartTransport
{
- get
- {
- return this.subtransport;
- }
+ get { return this.subtransport; }
}
private SmartSubtransport subtransport;
@@ -112,12 +104,15 @@ private unsafe static int Read(
{
bytes_read = UIntPtr.Zero;
- SmartSubtransportStream transportStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
+ SmartSubtransportStream transportStream =
+ GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
if (transportStream != null &&
buf_size.ToUInt64() < (ulong)long.MaxValue)
{
- using (UnmanagedMemoryStream memoryStream = new UnmanagedMemoryStream((byte*)buffer, 0, (long)buf_size.ToUInt64(), FileAccess.ReadWrite))
+ using (UnmanagedMemoryStream memoryStream = new UnmanagedMemoryStream((byte*)buffer, 0,
+ (long)buf_size.ToUInt64(),
+ FileAccess.ReadWrite))
{
try
{
@@ -139,15 +134,12 @@ private unsafe static int Read(
return (int)GitErrorCode.Error;
}
- private static unsafe int Write(
- IntPtr stream,
- IntPtr buffer,
- UIntPtr len)
+ private static unsafe int Write(IntPtr stream, IntPtr buffer, UIntPtr len)
{
- SmartSubtransportStream transportStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
+ SmartSubtransportStream transportStream =
+ GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
- if (transportStream != null &&
- len.ToUInt64() < (ulong)long.MaxValue)
+ if (transportStream != null && len.ToUInt64() < (ulong)long.MaxValue)
{
long length = (long)len.ToUInt64();
@@ -167,10 +159,10 @@ private static unsafe int Write(
return (int)GitErrorCode.Error;
}
- private static void Free(
- IntPtr stream)
+ private static void Free(IntPtr stream)
{
- SmartSubtransportStream transportStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
+ SmartSubtransportStream transportStream =
+ GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitSmartSubtransportStream.GCHandleOffset)).Target as SmartSubtransportStream;
if (transportStream != null)
{
diff --git a/LibGit2Sharp/StashCollection.cs b/LibGit2Sharp/StashCollection.cs
index 4cae63703..5fe775eba 100644
--- a/LibGit2Sharp/StashCollection.cs
+++ b/LibGit2Sharp/StashCollection.cs
@@ -42,8 +42,9 @@ internal StashCollection(Repository repo)
/// An object that can be used to iterate through the collection.
public virtual IEnumerator GetEnumerator()
{
- return Proxy.git_stash_foreach(repo.Handle,
- (index, message, commitId) => new Stash(repo, new ObjectId(commitId), index)).GetEnumerator();
+ Func resultSelector = (index, message, commitId) => new Stash(repo, new ObjectId(commitId), index);
+
+ return Proxy.git_stash_foreach(repo.Handle, resultSelector).GetEnumerator();
}
///
@@ -69,10 +70,15 @@ public virtual Stash this[int index]
throw new ArgumentOutOfRangeException("index", "The passed index must be a positive integer.");
}
- GitObject stashCommit = repo.Lookup(
- string.Format(CultureInfo.InvariantCulture, "stash@{{{0}}}", index), GitObjectType.Commit, LookUpOptions.None);
+ GitObject stashCommit = repo.Lookup(string.Format(CultureInfo.InvariantCulture,
+ "stash@{{{0}}}",
+ index),
+ GitObjectType.Commit,
+ LookUpOptions.None);
- return stashCommit == null ? null : new Stash(repo, stashCommit.Id, index);
+ return stashCommit == null
+ ? null
+ : new Stash(repo, stashCommit.Id, index);
}
}
@@ -235,8 +241,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/StatusEntry.cs b/LibGit2Sharp/StatusEntry.cs
index 1d62a0983..7008712c6 100644
--- a/LibGit2Sharp/StatusEntry.cs
+++ b/LibGit2Sharp/StatusEntry.cs
@@ -123,8 +123,9 @@ private string DebuggerDisplay
if ((State & FileStatus.RenamedInIndex) == FileStatus.RenamedInIndex ||
(State & FileStatus.RenamedInWorkdir) == FileStatus.RenamedInWorkdir)
{
- string oldFilePath = ((State & FileStatus.RenamedInIndex) == FileStatus.RenamedInIndex) ?
- HeadToIndexRenameDetails.OldFilePath : IndexToWorkDirRenameDetails.OldFilePath;
+ string oldFilePath = ((State & FileStatus.RenamedInIndex) != 0)
+ ? HeadToIndexRenameDetails.OldFilePath
+ : IndexToWorkDirRenameDetails.OldFilePath;
return string.Format(CultureInfo.InvariantCulture, "{0}: {1} -> {2}", State, oldFilePath, FilePath);
}
diff --git a/LibGit2Sharp/Submodule.cs b/LibGit2Sharp/Submodule.cs
index d832609a9..2b79a69d5 100644
--- a/LibGit2Sharp/Submodule.cs
+++ b/LibGit2Sharp/Submodule.cs
@@ -151,8 +151,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "{0} => {1}", Name, Url);
+ return string.Format(CultureInfo.InvariantCulture, "{0} => {1}", Name, Url);
}
}
diff --git a/LibGit2Sharp/SubmoduleCollection.cs b/LibGit2Sharp/SubmoduleCollection.cs
index 4c9a61fea..bc7aa4707 100644
--- a/LibGit2Sharp/SubmoduleCollection.cs
+++ b/LibGit2Sharp/SubmoduleCollection.cs
@@ -41,10 +41,9 @@ public virtual Submodule this[string name]
{
Ensure.ArgumentNotNullOrEmptyString(name, "name");
- return Lookup(name, handle =>
- new Submodule(repo, name,
- Proxy.git_submodule_path(handle),
- Proxy.git_submodule_url(handle)));
+ return Lookup(name, handle => new Submodule(repo, name,
+ Proxy.git_submodule_path(handle),
+ Proxy.git_submodule_url(handle)));
}
}
@@ -63,9 +62,9 @@ public virtual void Init(string name, bool overwrite)
{
if (handle == null)
{
- throw new NotFoundException(string.Format(
- CultureInfo.InvariantCulture,
- "Submodule lookup failed for '{0}'.", name));
+ throw new NotFoundException(string.Format(CultureInfo.InvariantCulture,
+ "Submodule lookup failed for '{0}'.",
+ name));
}
Proxy.git_submodule_init(handle, overwrite);
@@ -91,9 +90,9 @@ public virtual void Update(string name, SubmoduleUpdateOptions options)
{
if (handle == null)
{
- throw new NotFoundException(string.Format(
- CultureInfo.InvariantCulture,
- "Submodule lookup failed for '{0}'.", name));
+ throw new NotFoundException(string.Format(CultureInfo.InvariantCulture,
+ "Submodule lookup failed for '{0}'.",
+ name));
}
using (GitCheckoutOptsWrapper checkoutOptionsWrapper = new GitCheckoutOptsWrapper(options))
@@ -138,14 +137,15 @@ IEnumerator IEnumerable.GetEnumerator()
internal bool TryStage(string relativePath, bool writeIndex)
{
- return Lookup(relativePath, handle =>
- {
- if (handle == null)
- return false;
-
- Proxy.git_submodule_add_to_index(handle, writeIndex);
- return true;
- });
+ return Lookup(relativePath,
+ handle =>
+ {
+ if (handle == null)
+ return false;
+
+ Proxy.git_submodule_add_to_index(handle, writeIndex);
+ return true;
+ });
}
internal T Lookup(string name, Func selector, bool throwIfNotFound = false)
@@ -171,8 +171,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/SymbolicReference.cs b/LibGit2Sharp/SymbolicReference.cs
index 5bb475312..f4ad5bd86 100644
--- a/LibGit2Sharp/SymbolicReference.cs
+++ b/LibGit2Sharp/SymbolicReference.cs
@@ -45,9 +45,12 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0} => {1} => \"{2}\"",
- CanonicalName, TargetIdentifier,
- (Target != null) ? Target.TargetIdentifier : "?");
+ "{0} => {1} => \"{2}\"",
+ CanonicalName,
+ TargetIdentifier,
+ (Target != null)
+ ? Target.TargetIdentifier
+ : "?");
}
}
}
diff --git a/LibGit2Sharp/Tag.cs b/LibGit2Sharp/Tag.cs
index 35e02120c..cb2436346 100644
--- a/LibGit2Sharp/Tag.cs
+++ b/LibGit2Sharp/Tag.cs
@@ -13,8 +13,7 @@ protected Tag()
internal Tag(Repository repo, Reference reference, string canonicalName)
: base(repo, reference, _ => canonicalName)
- {
- }
+ { }
///
/// Gets the optional information associated to this tag.
diff --git a/LibGit2Sharp/TagAnnotation.cs b/LibGit2Sharp/TagAnnotation.cs
index 3028cfc16..96ef697c0 100644
--- a/LibGit2Sharp/TagAnnotation.cs
+++ b/LibGit2Sharp/TagAnnotation.cs
@@ -23,8 +23,12 @@ internal TagAnnotation(Repository repo, ObjectId id)
: base(repo, id)
{
lazyName = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tag_name);
- lazyTarget = GitObjectLazyGroup.Singleton(repo, id,
- obj => BuildFrom(repo, Proxy.git_tag_target_id(obj), Proxy.git_tag_target_type(obj), null));
+ lazyTarget = GitObjectLazyGroup.Singleton(repo,
+ id,
+ obj => BuildFrom(repo,
+ Proxy.git_tag_target_id(obj),
+ Proxy.git_tag_target_type(obj),
+ null));
group = new GitObjectLazyGroup(repo, id);
lazyTagger = group.AddLazy(Proxy.git_tag_tagger);
diff --git a/LibGit2Sharp/TagCollection.cs b/LibGit2Sharp/TagCollection.cs
index 4587d39b0..8bd9168b0 100644
--- a/LibGit2Sharp/TagCollection.cs
+++ b/LibGit2Sharp/TagCollection.cs
@@ -237,8 +237,7 @@ private string DebuggerDisplay
{
get
{
- return string.Format(CultureInfo.InvariantCulture,
- "Count = {0}", this.Count());
+ return string.Format(CultureInfo.InvariantCulture, "Count = {0}", this.Count());
}
}
}
diff --git a/LibGit2Sharp/TarArchiver.cs b/LibGit2Sharp/TarArchiver.cs
index 0710734fb..5b2d753ea 100644
--- a/LibGit2Sharp/TarArchiver.cs
+++ b/LibGit2Sharp/TarArchiver.cs
@@ -29,11 +29,23 @@ public override void BeforeArchiving(Tree tree, ObjectId oid, DateTimeOffset mod
}
// Store the sha in the pax_global_header
- using (var stream = new MemoryStream(Encoding.ASCII.GetBytes(
- string.Format(CultureInfo.InvariantCulture, "52 comment={0}\n", oid.Sha))))
+ using (var stream =
+ new MemoryStream(Encoding.ASCII.GetBytes(string.Format(CultureInfo.InvariantCulture,
+ "52 comment={0}\n",
+ oid.Sha))))
{
- writer.Write("pax_global_header", stream, modificationTime, "666".OctalToInt32(),
- "0", "0", 'g', "root", "root", "0", "0", oid.Sha, false);
+ writer.Write("pax_global_header",
+ stream, modificationTime,
+ "666".OctalToInt32(),
+ "0",
+ "0",
+ 'g',
+ "root",
+ "root",
+ "0",
+ "0",
+ oid.Sha,
+ false);
}
}
@@ -43,27 +55,55 @@ protected override void AddTreeEntry(string path, TreeEntry entry, DateTimeOffse
{
case Mode.GitLink:
case Mode.Directory:
- writer.Write(path + "/", null, modificationTime, "775".OctalToInt32(),
- "0", "0", '5', "root", "root", "0", "0", entry.TargetId.Sha, false);
+ writer.Write(path + "/",
+ null,
+ modificationTime,
+ "775".OctalToInt32(),
+ "0",
+ "0",
+ '5',
+ "root",
+ "root",
+ "0",
+ "0",
+ entry.TargetId.Sha,
+ false);
break;
case Mode.ExecutableFile:
case Mode.NonExecutableFile:
case Mode.NonExecutableGroupWritableFile:
- var blob = ((Blob) entry.Target);
+ var blob = ((Blob)entry.Target);
- WriteStream(path, entry, modificationTime,
- () => blob.IsBinary ? blob.GetContentStream() : blob.GetContentStream(new FilteringOptions(path)));
+ WriteStream(path,
+ entry,
+ modificationTime,
+ () => blob.IsBinary
+ ? blob.GetContentStream()
+ : blob.GetContentStream(new FilteringOptions(path)));
break;
case Mode.SymbolicLink:
using (Stream contentStream = ((Blob)entry.Target).GetContentStream(new FilteringOptions(path)))
{
- writer.Write(path, contentStream, modificationTime, "777".OctalToInt32(),
- "0", "0", '2', "root", "root", "0", "0", entry.TargetId.Sha, true);
+ writer.Write(path,
+ contentStream,
+ modificationTime,
+ "777".OctalToInt32(),
+ "0",
+ "0",
+ '2',
+ "root",
+ "root",
+ "0",
+ "0",
+ entry.TargetId.Sha,
+ true);
}
break;
default:
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "Unsupported file mode: {0} (sha1: {1}).", entry.Mode, entry.TargetId.Sha));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Unsupported file mode: {0} (sha1: {1}).",
+ entry.Mode,
+ entry.TargetId.Sha));
}
}
@@ -71,9 +111,21 @@ private void WriteStream(string path, TreeEntry entry, DateTimeOffset modificati
{
using (Stream contentStream = streamer())
{
- writer.Write(path, contentStream, modificationTime,
- (entry.Mode == Mode.ExecutableFile) ? "775".OctalToInt32() : "664".OctalToInt32(),
- "0", "0", '0', "root", "root", "0", "0", entry.TargetId.Sha, false);
+ writer.Write(path,
+ contentStream,
+ modificationTime,
+ (entry.Mode == Mode.ExecutableFile)
+ ? "775".OctalToInt32()
+ : "664".OctalToInt32(),
+ "0",
+ "0",
+ '0',
+ "root",
+ "root",
+ "0",
+ "0",
+ entry.TargetId.Sha,
+ false);
}
}
diff --git a/LibGit2Sharp/TransferProgress.cs b/LibGit2Sharp/TransferProgress.cs
index 29638103a..984c1741e 100644
--- a/LibGit2Sharp/TransferProgress.cs
+++ b/LibGit2Sharp/TransferProgress.cs
@@ -31,10 +31,7 @@ internal TransferProgress(GitTransferProgress gitTransferProgress)
///
public virtual int TotalObjects
{
- get
- {
- return (int) gitTransferProgress.total_objects;
- }
+ get { return (int)gitTransferProgress.total_objects; }
}
///
@@ -42,10 +39,7 @@ public virtual int TotalObjects
///
public virtual int IndexedObjects
{
- get
- {
- return (int) gitTransferProgress.indexed_objects;
- }
+ get { return (int)gitTransferProgress.indexed_objects; }
}
///
@@ -53,10 +47,7 @@ public virtual int IndexedObjects
///
public virtual int ReceivedObjects
{
- get
- {
- return (int) gitTransferProgress.received_objects;
- }
+ get { return (int)gitTransferProgress.received_objects; }
}
///
@@ -64,10 +55,7 @@ public virtual int ReceivedObjects
///
public virtual long ReceivedBytes
{
- get
- {
- return (long) gitTransferProgress.received_bytes;
- }
+ get { return (long)gitTransferProgress.received_bytes; }
}
private string DebuggerDisplay
@@ -75,7 +63,10 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0}/{1}, {2} bytes", ReceivedObjects, TotalObjects, ReceivedBytes);
+ "{0}/{1}, {2} bytes",
+ ReceivedObjects,
+ TotalObjects,
+ ReceivedBytes);
}
}
}
diff --git a/LibGit2Sharp/Tree.cs b/LibGit2Sharp/Tree.cs
index c70eb9ee1..9ef5f1e8f 100644
--- a/LibGit2Sharp/Tree.cs
+++ b/LibGit2Sharp/Tree.cs
@@ -107,7 +107,9 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "{0}, Count = {1}", Id.ToString(7), Count);
+ "{0}, Count = {1}",
+ Id.ToString(7),
+ Count);
}
}
}
diff --git a/LibGit2Sharp/TreeChanges.cs b/LibGit2Sharp/TreeChanges.cs
index ae3fd38cc..0e0d54c0e 100644
--- a/LibGit2Sharp/TreeChanges.cs
+++ b/LibGit2Sharp/TreeChanges.cs
@@ -32,16 +32,16 @@ public class TreeChanges : IEnumerable
private static IDictionary> Build()
{
return new Dictionary>
- {
- { ChangeKind.Modified, (de, d) => de.modified.Add(d) },
- { ChangeKind.Deleted, (de, d) => de.deleted.Add(d) },
- { ChangeKind.Added, (de, d) => de.added.Add(d) },
- { ChangeKind.TypeChanged, (de, d) => de.typeChanged.Add(d) },
- { ChangeKind.Unmodified, (de, d) => de.unmodified.Add(d) },
- { ChangeKind.Renamed, (de, d) => de.renamed.Add(d) },
- { ChangeKind.Copied, (de, d) => de.copied.Add(d) },
- { ChangeKind.Conflicted, (de, d) => de.conflicted.Add(d) },
- };
+ {
+ { ChangeKind.Modified, (de, d) => de.modified.Add(d) },
+ { ChangeKind.Deleted, (de, d) => de.deleted.Add(d) },
+ { ChangeKind.Added, (de, d) => de.added.Add(d) },
+ { ChangeKind.TypeChanged, (de, d) => de.typeChanged.Add(d) },
+ { ChangeKind.Unmodified, (de, d) => de.unmodified.Add(d) },
+ { ChangeKind.Renamed, (de, d) => de.renamed.Add(d) },
+ { ChangeKind.Copied, (de, d) => de.copied.Add(d) },
+ { ChangeKind.Conflicted, (de, d) => de.conflicted.Add(d) },
+ };
}
///
@@ -161,9 +161,13 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "+{0} ~{1} -{2} \u00B1{3} R{4} C{5}",
- Added.Count(), Modified.Count(), Deleted.Count(),
- TypeChanged.Count(), Renamed.Count(), Copied.Count());
+ "+{0} ~{1} -{2} \u00B1{3} R{4} C{5}",
+ Added.Count(),
+ Modified.Count(),
+ Deleted.Count(),
+ TypeChanged.Count(),
+ Renamed.Count(),
+ Copied.Count());
}
}
}
diff --git a/LibGit2Sharp/TreeDefinition.cs b/LibGit2Sharp/TreeDefinition.cs
index 8db64a100..8f016c204 100644
--- a/LibGit2Sharp/TreeDefinition.cs
+++ b/LibGit2Sharp/TreeDefinition.cs
@@ -134,9 +134,12 @@ public virtual TreeDefinition Add(string targetTreeEntryPath, TreeEntryDefinitio
if (treeEntryDefinition is TransientTreeTreeEntryDefinition)
{
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
- "The {0} references a target which hasn't been created in the {1} yet. " +
- "This situation can occur when the target is a whole new {2} being created, or when an existing {2} is being updated because some of its children were added/removed.",
- typeof(TreeEntryDefinition).Name, typeof(ObjectDatabase).Name, typeof(Tree).Name));
+ "The {0} references a target which hasn't been created in the {1} yet. " +
+ "This situation can occur when the target is a whole new {2} being created, " +
+ "or when an existing {2} is being updated because some of its children were added/removed.",
+ typeof(TreeEntryDefinition).Name,
+ typeof(ObjectDatabase).Name,
+ typeof(Tree).Name));
}
Tuple segments = ExtractPosixLeadingSegment(targetTreeEntryPath);
@@ -370,7 +373,9 @@ public virtual TreeEntryDefinition this[string treeEntryPath]
if (segments.Item2 != null)
{
TreeDefinition td = RetrieveOrBuildTreeDefinition(segments.Item1, false);
- return td == null ? null : td[segments.Item2];
+ return td == null
+ ? null
+ : td[segments.Item2];
}
TreeEntryDefinition treeEntryDefinition;
diff --git a/LibGit2Sharp/TreeEntry.cs b/LibGit2Sharp/TreeEntry.cs
index 54dd95998..dd2647554 100644
--- a/LibGit2Sharp/TreeEntry.cs
+++ b/LibGit2Sharp/TreeEntry.cs
@@ -84,10 +84,9 @@ private GitObject RetrieveTreeEntryTarget()
return GitObject.BuildFrom(repo, targetOid, TargetType.ToGitObjectType(), Path);
default:
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture,
- "TreeEntry target of type '{0}' is not supported.",
- TargetType));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "TreeEntry target of type '{0}' is not supported.",
+ TargetType));
}
}
diff --git a/LibGit2Sharp/TreeEntryChanges.cs b/LibGit2Sharp/TreeEntryChanges.cs
index e731de79d..f683a312d 100644
--- a/LibGit2Sharp/TreeEntryChanges.cs
+++ b/LibGit2Sharp/TreeEntryChanges.cs
@@ -94,8 +94,11 @@ private string DebuggerDisplay
get
{
return string.Format(CultureInfo.InvariantCulture,
- "Path = {0}, File {1}",
- !string.IsNullOrEmpty(Path) ? Path : OldPath, Status);
+ "Path = {0}, File {1}",
+ !string.IsNullOrEmpty(Path)
+ ? Path
+ : OldPath,
+ Status);
}
}
}
diff --git a/LibGit2Sharp/TreeEntryDefinition.cs b/LibGit2Sharp/TreeEntryDefinition.cs
index c0eb979d3..b89c59306 100644
--- a/LibGit2Sharp/TreeEntryDefinition.cs
+++ b/LibGit2Sharp/TreeEntryDefinition.cs
@@ -19,8 +19,7 @@ public class TreeEntryDefinition : IEquatable
/// Needed for mocking purposes.
///
protected TreeEntryDefinition()
- {
- }
+ { }
///
/// Gets file mode.
@@ -45,23 +44,23 @@ internal virtual GitObject Target
internal static TreeEntryDefinition From(TreeEntry treeEntry)
{
return new TreeEntryDefinition
- {
- Mode = treeEntry.Mode,
- TargetType = treeEntry.TargetType,
- TargetId = treeEntry.TargetId,
- target = new Lazy(() => treeEntry.Target)
- };
+ {
+ Mode = treeEntry.Mode,
+ TargetType = treeEntry.TargetType,
+ TargetId = treeEntry.TargetId,
+ target = new Lazy(() => treeEntry.Target)
+ };
}
internal static TreeEntryDefinition From(Blob blob, Mode mode)
{
return new TreeEntryDefinition
- {
- Mode = mode,
- TargetType = TreeEntryTargetType.Blob,
- TargetId = blob.Id,
- target = new Lazy(() => blob)
- };
+ {
+ Mode = mode,
+ TargetType = TreeEntryTargetType.Blob,
+ TargetId = blob.Id,
+ target = new Lazy(() => blob)
+ };
}
internal static TreeEntryDefinition TransientBlobFrom(string filePath, Mode mode)
@@ -69,32 +68,32 @@ internal static TreeEntryDefinition TransientBlobFrom(string filePath, Mode mode
Ensure.ArgumentConformsTo(mode, m => m.HasAny(BlobModes), "mode");
return new TransientBlobTreeEntryDefinition
- {
- Builder = odb => odb.CreateBlob(filePath),
- Mode = mode,
- };
+ {
+ Builder = odb => odb.CreateBlob(filePath),
+ Mode = mode,
+ };
}
internal static TreeEntryDefinition From(ObjectId objectId)
{
return new TreeEntryDefinition
- {
- Mode = Mode.GitLink,
- TargetType = TreeEntryTargetType.GitLink,
- TargetId = objectId,
- target = new Lazy(() => { throw new InvalidOperationException("Shouldn't be necessary."); }),
- };
+ {
+ Mode = Mode.GitLink,
+ TargetType = TreeEntryTargetType.GitLink,
+ TargetId = objectId,
+ target = new Lazy(() => { throw new InvalidOperationException("Shouldn't be necessary."); }),
+ };
}
internal static TreeEntryDefinition From(Tree tree)
{
return new TreeEntryDefinition
- {
- Mode = Mode.Directory,
- TargetType = TreeEntryTargetType.Tree,
- TargetId = tree.Id,
- target = new Lazy(() => tree)
- };
+ {
+ Mode = Mode.Directory,
+ TargetType = TreeEntryTargetType.Tree,
+ TargetId = tree.Id,
+ target = new Lazy(() => tree)
+ };
}
///
diff --git a/LibGit2Sharp/TreeEntryTargetType.cs b/LibGit2Sharp/TreeEntryTargetType.cs
index a4e54d73a..46ceb7d92 100644
--- a/LibGit2Sharp/TreeEntryTargetType.cs
+++ b/LibGit2Sharp/TreeEntryTargetType.cs
@@ -38,8 +38,9 @@ public static GitObjectType ToGitObjectType(this TreeEntryTargetType type)
return GitObjectType.Blob;
default:
- throw new InvalidOperationException(
- string.Format(CultureInfo.InvariantCulture, "Cannot map {0} to a GitObjectType.", type));
+ throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
+ "Cannot map {0} to a GitObjectType.",
+ type));
}
}
}
diff --git a/LibGit2Sharp/UnbornBranchException.cs b/LibGit2Sharp/UnbornBranchException.cs
index ac2b1ee2a..0d553e3d1 100644
--- a/LibGit2Sharp/UnbornBranchException.cs
+++ b/LibGit2Sharp/UnbornBranchException.cs
@@ -15,8 +15,7 @@ public class UnbornBranchException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public UnbornBranchException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public UnbornBranchException()
/// A message that describes the error.
public UnbornBranchException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -35,8 +33,7 @@ public UnbornBranchException(string message)
/// An object array that contains zero or more objects to format.
public UnbornBranchException(CultureInfo cultureInfo, string format, params object[] args)
: base(String.Format(cultureInfo, format, args))
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -45,8 +42,7 @@ public UnbornBranchException(CultureInfo cultureInfo, string format, params obje
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public UnbornBranchException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -55,7 +51,6 @@ public UnbornBranchException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected UnbornBranchException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/UnmatchedPathException.cs b/LibGit2Sharp/UnmatchedPathException.cs
index e63b35149..ae5f3386c 100644
--- a/LibGit2Sharp/UnmatchedPathException.cs
+++ b/LibGit2Sharp/UnmatchedPathException.cs
@@ -13,8 +13,7 @@ public class UnmatchedPathException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public UnmatchedPathException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -22,8 +21,7 @@ public UnmatchedPathException()
/// A message that describes the error.
public UnmatchedPathException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -32,8 +30,7 @@ public UnmatchedPathException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public UnmatchedPathException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -42,7 +39,6 @@ public UnmatchedPathException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected UnmatchedPathException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/UnmergedIndexEntriesException.cs b/LibGit2Sharp/UnmergedIndexEntriesException.cs
index f221b4a61..6cfa020c1 100644
--- a/LibGit2Sharp/UnmergedIndexEntriesException.cs
+++ b/LibGit2Sharp/UnmergedIndexEntriesException.cs
@@ -15,8 +15,7 @@ public class UnmergedIndexEntriesException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public UnmergedIndexEntriesException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -24,8 +23,7 @@ public UnmergedIndexEntriesException()
/// A message that describes the error.
public UnmergedIndexEntriesException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -34,8 +32,7 @@ public UnmergedIndexEntriesException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public UnmergedIndexEntriesException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -44,12 +41,10 @@ public UnmergedIndexEntriesException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected UnmergedIndexEntriesException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal UnmergedIndexEntriesException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/UserCanceledException.cs b/LibGit2Sharp/UserCanceledException.cs
index fdc03396e..45ab75f34 100644
--- a/LibGit2Sharp/UserCanceledException.cs
+++ b/LibGit2Sharp/UserCanceledException.cs
@@ -14,8 +14,7 @@ public class UserCancelledException : LibGit2SharpException
/// Initializes a new instance of the class.
///
public UserCancelledException()
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message.
@@ -23,8 +22,7 @@ public UserCancelledException()
/// A message that describes the error.
public UserCancelledException(string message)
: base(message)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
@@ -33,8 +31,7 @@ public UserCancelledException(string message)
/// The exception that is the cause of the current exception. If the parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.
public UserCancelledException(string message, Exception innerException)
: base(message, innerException)
- {
- }
+ { }
///
/// Initializes a new instance of the class with a serialized data.
@@ -43,12 +40,10 @@ public UserCancelledException(string message, Exception innerException)
/// The that contains contextual information about the source or destination.
protected UserCancelledException(SerializationInfo info, StreamingContext context)
: base(info, context)
- {
- }
+ { }
internal UserCancelledException(string message, GitErrorCode code, GitErrorCategory category)
: base(message, code, category)
- {
- }
+ { }
}
}
diff --git a/LibGit2Sharp/Version.cs b/LibGit2Sharp/Version.cs
index fbc6ef891..4a155dcba 100644
--- a/LibGit2Sharp/Version.cs
+++ b/LibGit2Sharp/Version.cs
@@ -46,10 +46,7 @@ public virtual string InformationalVersion
/// A enumeration.
public virtual BuiltInFeatures Features
{
- get
- {
- return Proxy.git_libgit2_features();
- }
+ get { return Proxy.git_libgit2_features(); }
}
///
@@ -92,14 +89,13 @@ private string RetrieveVersion()
{
string features = Features.ToString();
- return string.Format(
- CultureInfo.InvariantCulture,
- "{0}-{1}-{2} ({3} - {4})",
- InformationalVersion,
- LibGit2SharpCommitSha,
- LibGit2CommitSha,
- Platform.ProcessorArchitecture,
- features);
+ return string.Format(CultureInfo.InvariantCulture,
+ "{0}-{1}-{2} ({3} - {4})",
+ InformationalVersion,
+ LibGit2SharpCommitSha,
+ LibGit2CommitSha,
+ Platform.ProcessorArchitecture,
+ features);
}
private string ReadContentFromResource(Assembly assembly, string partialResourceName)