diff --git a/LibGit2Sharp.Tests/CommitFixture.cs b/LibGit2Sharp.Tests/CommitFixture.cs index d2badd7b8..82148246d 100644 --- a/LibGit2Sharp.Tests/CommitFixture.cs +++ b/LibGit2Sharp.Tests/CommitFixture.cs @@ -538,32 +538,11 @@ public void DirectlyAccessingAnUnknownTreeEntryOfTheCommitReturnsNull() } } - [Theory] - [InlineData(null, "x@example.com")] - [InlineData("", "x@example.com")] - [InlineData("X", null)] - [InlineData("X", "")] - public void CommitWithInvalidSignatureConfigThrows(string name, string email) - { - string repoPath = InitNewRepository(); - string configPath = CreateConfigurationWithDummyUser(name, email); - var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; - - using (var repo = new Repository(repoPath, options)) - { - Assert.Equal(name, repo.Config.GetValueOrDefault("user.name")); - Assert.Equal(email, repo.Config.GetValueOrDefault("user.email")); - - Assert.Throws( - () => repo.Commit("Initial egotistic commit", new CommitOptions { AllowEmptyCommit = true })); - } - } - [Fact] public void CanCommitWithSignatureFromConfig() { string repoPath = InitNewRepository(); - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, options)) @@ -581,12 +560,14 @@ public void CanCommitWithSignatureFromConfig() Assert.Null(repo.Head[relativeFilepath]); - Commit commit = repo.Commit("Initial egotistic commit"); + Signature signature = repo.Config.BuildSignature(DateTimeOffset.Now); + + Commit commit = repo.Commit("Initial egotistic commit", signature, signature); AssertBlobContent(repo.Head[relativeFilepath], "nulltoken\n"); AssertBlobContent(commit[relativeFilepath], "nulltoken\n"); - AssertCommitSignaturesAre(commit, Constants.Signature); + AssertCommitIdentitiesAre(commit, Constants.Identity); } } diff --git a/LibGit2Sharp.Tests/ConfigurationFixture.cs b/LibGit2Sharp.Tests/ConfigurationFixture.cs index 50b6fdc7a..1799ef74d 100644 --- a/LibGit2Sharp.Tests/ConfigurationFixture.cs +++ b/LibGit2Sharp.Tests/ConfigurationFixture.cs @@ -143,7 +143,7 @@ public void CanReadStringValue() [Fact] public void CanEnumerateGlobalConfig() { - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; var path = SandboxStandardTestRepoGitDir(); @@ -200,7 +200,7 @@ public void CanFindInLocalConfig() [Fact] public void CanFindInGlobalConfig() { - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; var path = SandboxStandardTestRepoGitDir(); @@ -387,7 +387,7 @@ public void CanAccessConfigurationWithoutARepository(Func localC { var path = SandboxStandardTestRepoGitDir(); - string globalConfigPath = CreateConfigurationWithDummyUser(Constants.Signature); + string globalConfigPath = CreateConfigurationWithDummyUser(Constants.Identity); var options = new RepositoryOptions { GlobalConfigurationLocation = globalConfigPath }; using (var repo = new Repository(path, options)) @@ -409,5 +409,27 @@ public void PassingANonExistingLocalConfigurationFileToBuildFromthrowss() Assert.Throws(() => Configuration.BuildFrom( Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()))); } + + [Theory] + [InlineData(null, "x@example.com")] + [InlineData("", "x@example.com")] + [InlineData("X", null)] + [InlineData("X", "")] + public void CannotBuildAProperSignatureFromConfigWhenFullIdentityCannotBeFoundInTheConfig(string name, string email) + { + string repoPath = InitNewRepository(); + string configPath = CreateConfigurationWithDummyUser(name, email); + var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; + + using (var repo = new Repository(repoPath, options)) + { + Assert.Equal(name, repo.Config.GetValueOrDefault("user.name")); + Assert.Equal(email, repo.Config.GetValueOrDefault("user.email")); + + Signature signature = repo.Config.BuildSignature(DateTimeOffset.Now); + + Assert.Null(signature); + } + } } } diff --git a/LibGit2Sharp.Tests/FilterFixture.cs b/LibGit2Sharp.Tests/FilterFixture.cs index e8c5f0df9..b313981a9 100644 --- a/LibGit2Sharp.Tests/FilterFixture.cs +++ b/LibGit2Sharp.Tests/FilterFixture.cs @@ -159,7 +159,7 @@ public void CleanFilterWritesOutputToObjectTree() using (var repo = CreateTestRepository(repoPath)) { FileInfo expectedFile = StageNewFile(repo, decodedInput); - var commit = repo.Commit("Clean that file"); + var commit = repo.Commit("Clean that file", Constants.Signature, Constants.Signature); var blob = (Blob)commit.Tree[expectedFile.Name].Target; var textDetected = blob.GetContentText(); @@ -232,7 +232,7 @@ public void CanFilterLargeFiles() string attributesPath = Path.Combine(Directory.GetParent(repoPath).Parent.FullName, ".gitattributes"); FileInfo attributesFile = new FileInfo(attributesPath); - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (Repository repo = new Repository(repoPath, repositoryOptions)) @@ -240,7 +240,7 @@ public void CanFilterLargeFiles() File.WriteAllText(attributesPath, "*.blob filter=test"); repo.Stage(attributesFile.Name); repo.Stage(contentFile.Name); - repo.Commit("test"); + repo.Commit("test", Constants.Signature, Constants.Signature); contentFile.Delete(); repo.Checkout("HEAD", new CheckoutOptions() { CheckoutModifiers = CheckoutModifiers.Force }); } @@ -346,7 +346,7 @@ private FileInfo CheckoutFileForSmudge(string repoPath, string branchName, strin { StageNewFile(repo, content); - repo.Commit("Initial commit"); + repo.Commit("Initial commit", Constants.Signature, Constants.Signature); expectedPath = CommitFileOnBranch(repo, branchName, content); @@ -363,7 +363,7 @@ private static FileInfo CommitFileOnBranch(Repository repo, string branchName, S repo.Checkout(branch.FriendlyName); FileInfo expectedPath = StageNewFile(repo, content); - repo.Commit("Commit"); + repo.Commit("Commit", Constants.Signature, Constants.Signature); return expectedPath; } @@ -377,7 +377,7 @@ private static FileInfo StageNewFile(IRepository repo, string contents = "null") private Repository CreateTestRepository(string path) { - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; var repository = new Repository(path, repositoryOptions); CreateAttributesFile(repository, "* filter=test"); diff --git a/LibGit2Sharp.Tests/FilterSubstitutionCipherFixture.cs b/LibGit2Sharp.Tests/FilterSubstitutionCipherFixture.cs index 90df4e93b..a57197626 100644 --- a/LibGit2Sharp.Tests/FilterSubstitutionCipherFixture.cs +++ b/LibGit2Sharp.Tests/FilterSubstitutionCipherFixture.cs @@ -21,7 +21,7 @@ public void SmugdeIsNotCalledForFileWhichDoesNotMatchAnAttributeEntry() string repoPath = InitNewRepository(); string fileName = Guid.NewGuid() + ".rot13"; - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, repositoryOptions)) { @@ -61,7 +61,7 @@ public void CorrectlyEncodesAndDecodesInput() string repoPath = InitNewRepository(); string fileName = Guid.NewGuid() + ".rot13"; - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, repositoryOptions)) { @@ -106,7 +106,7 @@ public void WhenStagedFileDoesNotMatchPathSpecFileIsNotFiltered(string pathSpec, string repoPath = InitNewRepository(); string fileName = Guid.NewGuid() + fileExtension; - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, repositoryOptions)) { @@ -141,7 +141,7 @@ public void CleanIsCalledIfAttributeEntryMatches(string filterAttribute, string string repoPath = InitNewRepository(); string fileName = Guid.NewGuid() + ".txt"; - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, repositoryOptions)) { @@ -172,7 +172,7 @@ public void SmudgeIsCalledIfAttributeEntryMatches(string filterAttribute, string string repoPath = InitNewRepository(); string fileName = Guid.NewGuid() + ".txt"; - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath }; using (var repo = new Repository(repoPath, repositoryOptions)) { @@ -203,7 +203,7 @@ private static void DeleteFile(Repository repo, string fileName) { File.Delete(Path.Combine(repo.Info.WorkingDirectory, fileName)); repo.Stage(fileName); - repo.Commit("remove file"); + repo.Commit("remove file", Constants.Signature, Constants.Signature); } private static Blob CommitOnBranchAndReturnDatabaseBlob(Repository repo, string fileName, string input) @@ -211,7 +211,7 @@ private static Blob CommitOnBranchAndReturnDatabaseBlob(Repository repo, string Touch(repo.Info.WorkingDirectory, fileName, input); repo.Stage(fileName); - var commit = repo.Commit("new file"); + var commit = repo.Commit("new file", Constants.Signature, Constants.Signature); var blob = (Blob)commit.Tree[fileName].Target; return blob; diff --git a/LibGit2Sharp.Tests/NoteFixture.cs b/LibGit2Sharp.Tests/NoteFixture.cs index 7da99db07..0c879e3e1 100644 --- a/LibGit2Sharp.Tests/NoteFixture.cs +++ b/LibGit2Sharp.Tests/NoteFixture.cs @@ -168,14 +168,17 @@ public void CreatingANoteWhichAlreadyExistsOverwritesThePreviousNote() [Fact] public void CanAddANoteWithSignatureFromConfig() { - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); var options = new RepositoryOptions { GlobalConfigurationLocation = configPath }; string path = SandboxBareTestRepo(); using (var repo = new Repository(path, options)) { var commit = repo.Lookup("9fd738e8f7967c078dceed8190330fc8648ee56a"); - var note = repo.Notes.Add(commit.Id, "I'm batman!\n", "batmobile"); + + Signature signature = repo.Config.BuildSignature(DateTimeOffset.Now); + + var note = repo.Notes.Add(commit.Id, "I'm batman!\n", signature, signature, "batmobile"); var newNote = commit.Notes.Single(); Assert.Equal(note, newNote); @@ -183,7 +186,7 @@ public void CanAddANoteWithSignatureFromConfig() Assert.Equal("I'm batman!\n", newNote.Message); Assert.Equal("batmobile", newNote.Namespace); - AssertCommitSignaturesAre(repo.Lookup("refs/notes/batmobile"), Constants.Signature); + AssertCommitIdentitiesAre(repo.Lookup("refs/notes/batmobile"), Constants.Identity); } } @@ -265,7 +268,7 @@ public void RemovingANonExistingNoteDoesntThrow() [Fact] public void CanRemoveANoteWithSignatureFromConfig() { - string configPath = CreateConfigurationWithDummyUser(Constants.Signature); + string configPath = CreateConfigurationWithDummyUser(Constants.Identity); RepositoryOptions options = new RepositoryOptions() { GlobalConfigurationLocation = configPath }; string path = SandboxBareTestRepo(); @@ -276,11 +279,13 @@ public void CanRemoveANoteWithSignatureFromConfig() Assert.NotEmpty(notes); - repo.Notes.Remove(commit.Id, repo.Notes.DefaultNamespace); + Signature signature = repo.Config.BuildSignature(DateTimeOffset.Now); + + repo.Notes.Remove(commit.Id, signature, signature, repo.Notes.DefaultNamespace); Assert.Empty(notes); - AssertCommitSignaturesAre(repo.Lookup("refs/notes/" + repo.Notes.DefaultNamespace), Constants.Signature); + AssertCommitIdentitiesAre(repo.Lookup("refs/notes/" + repo.Notes.DefaultNamespace), Constants.Identity); } } diff --git a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs index b7a607db0..3c1f6e2e0 100644 --- a/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs +++ b/LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs @@ -328,11 +328,11 @@ private static RepositoryOptions BuildFakeRepositoryOptions(SelfCleaningDirector /// Creates a configuration file with user.name and user.email set to signature /// /// The configuration file will be removed automatically when the tests are finished - /// The signature to use for user.name and user.email + /// The identity to use for user.name and user.email /// The path to the configuration file - protected string CreateConfigurationWithDummyUser(Signature signature) + protected string CreateConfigurationWithDummyUser(Identity identity) { - return CreateConfigurationWithDummyUser(signature.Name, signature.Email); + return CreateConfigurationWithDummyUser(identity.Name, identity.Email); } protected string CreateConfigurationWithDummyUser(string name, string email) @@ -361,13 +361,13 @@ protected string CreateConfigurationWithDummyUser(string name, string email) /// Asserts that the commit has been authored and committed by the specified signature /// /// The commit - /// The signature to compare author and commiter to - protected void AssertCommitSignaturesAre(Commit commit, Signature signature) + /// The identity to compare author and commiter to + protected void AssertCommitIdentitiesAre(Commit commit, Identity identity) { - Assert.Equal(signature.Name, commit.Author.Name); - Assert.Equal(signature.Email, commit.Author.Email); - Assert.Equal(signature.Name, commit.Committer.Name); - Assert.Equal(signature.Email, commit.Committer.Email); + Assert.Equal(identity.Name, commit.Author.Name); + Assert.Equal(identity.Email, commit.Author.Email); + Assert.Equal(identity.Name, commit.Committer.Name); + Assert.Equal(identity.Email, commit.Committer.Email); } protected static string Touch(string parent, string file, string content = null, Encoding encoding = null) diff --git a/LibGit2Sharp/CheckoutOptions.cs b/LibGit2Sharp/CheckoutOptions.cs index e95532cb5..010502007 100644 --- a/LibGit2Sharp/CheckoutOptions.cs +++ b/LibGit2Sharp/CheckoutOptions.cs @@ -34,8 +34,8 @@ CheckoutStrategy IConvertableToGitCheckoutOpts.CheckoutStrategy { get { - return CheckoutModifiers.HasFlag(CheckoutModifiers.Force) - ? CheckoutStrategy.GIT_CHECKOUT_FORCE + return CheckoutModifiers.HasFlag(CheckoutModifiers.Force) + ? CheckoutStrategy.GIT_CHECKOUT_FORCE : CheckoutStrategy.GIT_CHECKOUT_SAFE; } } diff --git a/LibGit2Sharp/Commit.cs b/LibGit2Sharp/Commit.cs index 40429cd05..d878655ef 100644 --- a/LibGit2Sharp/Commit.cs +++ b/LibGit2Sharp/Commit.cs @@ -118,8 +118,8 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0} {1}", - Id.ToString(7), + "{0} {1}", + Id.ToString(7), MessageShort); } } diff --git a/LibGit2Sharp/ConflictCollection.cs b/LibGit2Sharp/ConflictCollection.cs index 229f091ad..90d48fa33 100644 --- a/LibGit2Sharp/ConflictCollection.cs +++ b/LibGit2Sharp/ConflictCollection.cs @@ -104,7 +104,7 @@ private List AllConflicts() default: throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Entry '{0}' bears an unexpected StageLevel '{1}'", - entry.Path, + entry.Path, entry.StageLevel)); } } diff --git a/LibGit2Sharp/ContentChanges.cs b/LibGit2Sharp/ContentChanges.cs index c2c703610..dee15abee 100644 --- a/LibGit2Sharp/ContentChanges.cs +++ b/LibGit2Sharp/ContentChanges.cs @@ -124,7 +124,7 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, @"{{+{0}, -{1}}}", - LinesAdded, + LinesAdded, LinesDeleted); } } diff --git a/LibGit2Sharp/Core/EncodingMarshaler.cs b/LibGit2Sharp/Core/EncodingMarshaler.cs index 490cb69b8..fadc15610 100644 --- a/LibGit2Sharp/Core/EncodingMarshaler.cs +++ b/LibGit2Sharp/Core/EncodingMarshaler.cs @@ -43,8 +43,8 @@ public virtual IntPtr MarshalManagedToNative(Object managedObj) if (str == null) { - throw new MarshalDirectiveException(string.Format(CultureInfo.InvariantCulture, - "{0} must be used on a string.", + throw new MarshalDirectiveException(string.Format(CultureInfo.InvariantCulture, + "{0} must be used on a string.", GetType().Name)); } diff --git a/LibGit2Sharp/Core/FilePath.cs b/LibGit2Sharp/Core/FilePath.cs index 097d32283..580138cd0 100644 --- a/LibGit2Sharp/Core/FilePath.cs +++ b/LibGit2Sharp/Core/FilePath.cs @@ -60,8 +60,8 @@ private static string Replace(string path, char oldChar, char newChar) public bool Equals(FilePath other) { - return other == null - ? posix == null + return other == null + ? posix == null : string.Equals(posix, other.posix, StringComparison.Ordinal); } diff --git a/LibGit2Sharp/Core/FilePathMarshaler.cs b/LibGit2Sharp/Core/FilePathMarshaler.cs index 56d42444b..db28409c1 100644 --- a/LibGit2Sharp/Core/FilePathMarshaler.cs +++ b/LibGit2Sharp/Core/FilePathMarshaler.cs @@ -68,8 +68,8 @@ public override IntPtr MarshalManagedToNative(Object managedObj) if (null == filePath) { - throw new MarshalDirectiveException(string.Format(CultureInfo.InvariantCulture, - "{0} must be used on a FilePath.", + throw new MarshalDirectiveException(string.Format(CultureInfo.InvariantCulture, + "{0} must be used on a FilePath.", GetType().Name)); } diff --git a/LibGit2Sharp/Core/GitBlame.cs b/LibGit2Sharp/Core/GitBlame.cs index 9db093906..9db27d25e 100644 --- a/LibGit2Sharp/Core/GitBlame.cs +++ b/LibGit2Sharp/Core/GitBlame.cs @@ -79,8 +79,8 @@ 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", + throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, + "{0} is not supported at this time", strategy)); } } diff --git a/LibGit2Sharp/Core/GitFilter.cs b/LibGit2Sharp/Core/GitFilter.cs index 9074c7716..648cf47ec 100644 --- a/LibGit2Sharp/Core/GitFilter.cs +++ b/LibGit2Sharp/Core/GitFilter.cs @@ -70,9 +70,9 @@ internal class GitFilter /// callback to free the payload. /// public delegate int git_filter_check_fn( - GitFilter gitFilter, - IntPtr payload, - IntPtr filterSource, + GitFilter gitFilter, + IntPtr payload, + IntPtr filterSource, IntPtr attributeValues); /// @@ -86,17 +86,17 @@ 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, + 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, + out IntPtr git_writestream_out, + GitFilter self, + IntPtr payload, + IntPtr filterSource, IntPtr git_writestream_next); /// diff --git a/LibGit2Sharp/Core/HistoryRewriter.cs b/LibGit2Sharp/Core/HistoryRewriter.cs index 784c1cc9c..a805a6a1a 100644 --- a/LibGit2Sharp/Core/HistoryRewriter.cs +++ b/LibGit2Sharp/Core/HistoryRewriter.cs @@ -302,8 +302,8 @@ private GitObject RewriteTarget(GitObject oldTarget) newName = options.TagNameRewriter(annotation.Name, true, annotation.Target.Sha); } - var newAnnotation = repo.ObjectDatabase.CreateTagAnnotation(newName, - newTarget, + var newAnnotation = repo.ObjectDatabase.CreateTagAnnotation(newName, + newTarget, annotation.Tagger, annotation.Message); objectMap[annotation] = newAnnotation; diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index c170cb392..11b3ca209 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -702,15 +702,15 @@ 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, + int res = NativeMethods.git_diff_blobs(osw1.ObjectPtr, + null, + osw2.ObjectPtr, + null, + options, + fileCallback, + null, + hunkCallback, + lineCallback, IntPtr.Zero); Ensure.ZeroResult(res); @@ -2705,8 +2705,8 @@ public static ICollection git_stash_foreach( { 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), + (UIntPtr i, IntPtr m, ref GitOid x, IntPtr p) + => c((int)i, m, x, p), IntPtr.Zero), GitErrorCode.NotFound); } @@ -2771,7 +2771,7 @@ 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 " + + "You can either force a literal path evaluation " + "(GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH), or use git_status_foreach().", path); diff --git a/LibGit2Sharp/Core/TarWriter.cs b/LibGit2Sharp/Core/TarWriter.cs index ea2368438..7c479cec9 100644 --- a/LibGit2Sharp/Core/TarWriter.cs +++ b/LibGit2Sharp/Core/TarWriter.cs @@ -460,9 +460,9 @@ public static FileNameExtendedHeader Parse(string posixPath, string entrySha) return new FileNameExtendedHeader(posixPath, string.Empty, - string.Format(CultureInfo.InvariantCulture, - "{0}.data", - entrySha), + string.Format(CultureInfo.InvariantCulture, + "{0}.data", + entrySha), true); } diff --git a/LibGit2Sharp/Core/Utf8Marshaler.cs b/LibGit2Sharp/Core/Utf8Marshaler.cs index 17ee637f5..c56a71c5f 100644 --- a/LibGit2Sharp/Core/Utf8Marshaler.cs +++ b/LibGit2Sharp/Core/Utf8Marshaler.cs @@ -105,8 +105,8 @@ 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.", + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, + "{0} cannot be used to pass data to libgit2.", GetType().Name)); } diff --git a/LibGit2Sharp/Filter.cs b/LibGit2Sharp/Filter.cs index 770471f6f..e7dbc910b 100644 --- a/LibGit2Sharp/Filter.cs +++ b/LibGit2Sharp/Filter.cs @@ -10,7 +10,7 @@ namespace LibGit2Sharp { /// /// A filter is a way to execute code against a file as it moves to and from the git - /// repository and into the working directory. + /// repository and into the working directory. /// public abstract class Filter : IEquatable { @@ -87,7 +87,7 @@ internal GitFilter GitFilter /// /// Complete callback on filter - /// + /// /// This optional callback will be invoked when the upstream filter is /// closed. Gives the filter a chance to perform any final actions or /// necissary clean up. diff --git a/LibGit2Sharp/FilterRegistration.cs b/LibGit2Sharp/FilterRegistration.cs index 710f4f69c..f6c1e31d0 100644 --- a/LibGit2Sharp/FilterRegistration.cs +++ b/LibGit2Sharp/FilterRegistration.cs @@ -19,7 +19,7 @@ public sealed class FilterRegistration public const int FilterPriorityMin = 0; /// - /// + /// /// /// /// diff --git a/LibGit2Sharp/GitObjectMetadata.cs b/LibGit2Sharp/GitObjectMetadata.cs index 3e0e939e6..348fa4daa 100644 --- a/LibGit2Sharp/GitObjectMetadata.cs +++ b/LibGit2Sharp/GitObjectMetadata.cs @@ -10,7 +10,7 @@ public sealed class GitObjectMetadata private readonly GitObjectType type; /// - /// Size of the Object + /// Size of the Object /// public long Size { get; private set; } diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs index 8c7c7bf16..399ada7cf 100644 --- a/LibGit2Sharp/GlobalSettings.cs +++ b/LibGit2Sharp/GlobalSettings.cs @@ -200,7 +200,7 @@ public static FilterRegistration RegisterFilter(Filter filter) /// Registers a to be invoked when matches .gitattributes 'filter=name' /// /// The filter to be invoked at run time. - /// The priroty of the filter to invoked. + /// The priroty of the filter to invoked. /// A value of 0 () will be run first on checkout and last on checkin. /// A value of 200 () will be run last on checkout and first on checkin. /// @@ -222,7 +222,7 @@ public static FilterRegistration RegisterFilter(Filter filter, int priority) lock (registeredFilters) { - // if the filter has already been registered + // if the filter has already been registered if (registeredFilters.ContainsKey(filter)) { throw new EntryExistsException("The filter has already been registered.", GitErrorCode.Exists, GitErrorCategory.Filter); @@ -251,7 +251,7 @@ public static void DeregisterFilter(FilterRegistration registration) // do nothing if the filter isn't registered if (registeredFilters.ContainsKey(filter)) - { + { // remove the register from the global tracking list registeredFilters.Remove(filter); // clean up native allocations diff --git a/LibGit2Sharp/IndexEntry.cs b/LibGit2Sharp/IndexEntry.cs index b8a39db6a..501d12717 100644 --- a/LibGit2Sharp/IndexEntry.cs +++ b/LibGit2Sharp/IndexEntry.cs @@ -117,9 +117,9 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0} ({1}) => \"{2}\"", - Path, - StageLevel, + "{0} ({1}) => \"{2}\"", + Path, + StageLevel, Id.ToString(7)); } } diff --git a/LibGit2Sharp/IndexNameEntry.cs b/LibGit2Sharp/IndexNameEntry.cs index b8153c953..5ba24f9c3 100644 --- a/LibGit2Sharp/IndexNameEntry.cs +++ b/LibGit2Sharp/IndexNameEntry.cs @@ -120,9 +120,9 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0} {1} {2}", - Ancestor, - Ours, + "{0} {1} {2}", + Ancestor, + Ours, Theirs); } } diff --git a/LibGit2Sharp/IndexReucEntry.cs b/LibGit2Sharp/IndexReucEntry.cs index 788f14be2..144e5c3c9 100644 --- a/LibGit2Sharp/IndexReucEntry.cs +++ b/LibGit2Sharp/IndexReucEntry.cs @@ -145,10 +145,10 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0}: {1} {2} {3}", - Path, - AncestorId, - OurId, + "{0}: {1} {2} {3}", + Path, + AncestorId, + OurId, TheirId); } } diff --git a/LibGit2Sharp/Network.cs b/LibGit2Sharp/Network.cs index be3f2423b..154ba79f0 100644 --- a/LibGit2Sharp/Network.cs +++ b/LibGit2Sharp/Network.cs @@ -429,10 +429,10 @@ public virtual void Push( Ensure.ArgumentNotNull(objectish, "objectish"); Ensure.ArgumentNotNullOrEmptyString(destinationSpec, "destinationSpec"); - Push(remote, + Push(remote, string.Format(CultureInfo.InvariantCulture, - "{0}:{1}", - objectish, + "{0}:{1}", + objectish, destinationSpec)); } @@ -452,11 +452,11 @@ public virtual void Push( Ensure.ArgumentNotNull(objectish, "objectish"); Ensure.ArgumentNotNullOrEmptyString(destinationSpec, "destinationSpec"); - Push(remote, + Push(remote, string.Format(CultureInfo.InvariantCulture, - "{0}:{1}", - objectish, - destinationSpec), + "{0}:{1}", + objectish, + destinationSpec), pushOptions); } @@ -570,7 +570,7 @@ internal virtual IEnumerable FetchHeads { int i = 0; - Func resultSelector = + 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/Note.cs b/LibGit2Sharp/Note.cs index 0feebb9da..e40bec67e 100644 --- a/LibGit2Sharp/Note.cs +++ b/LibGit2Sharp/Note.cs @@ -115,8 +115,8 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, "Target \"{0}\", Namespace \"{1}\": {2}", - TargetObjectId.ToString(7), - Namespace, + TargetObjectId.ToString(7), + Namespace, Message); } } diff --git a/LibGit2Sharp/NoteCollection.cs b/LibGit2Sharp/NoteCollection.cs index c722221ce..7c8c8ecc8 100644 --- a/LibGit2Sharp/NoteCollection.cs +++ b/LibGit2Sharp/NoteCollection.cs @@ -171,6 +171,7 @@ internal static string UnCanonicalizeName(string name) /// The note message. /// The namespace on which the note will be created. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace'). /// The note which was just saved. + [Obsolete("This method will be removed in the next release. Please use Add(ObjectId, string, Signature, Signature, string) instead.")] public virtual Note Add(ObjectId targetId, string message, string @namespace) { Signature author = repo.Config.BuildSignatureOrThrow(DateTimeOffset.Now); @@ -210,6 +211,7 @@ public virtual Note Add(ObjectId targetId, string message, Signature author, Sig /// /// The target , for which the note will be created. /// The namespace on which the note will be removed. It can be either a canonical namespace or an abbreviated namespace ('refs/notes/myNamespace' or just 'myNamespace'). + [Obsolete("This method will be removed in the next release. Please use Remove(ObjectId, Signature, Signature, string) instead.")] public virtual void Remove(ObjectId targetId, string @namespace) { Signature author = repo.Config.BuildSignatureOrThrow(DateTimeOffset.Now); diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs index d855e2c6f..5376fdb87 100644 --- a/LibGit2Sharp/ObjectDatabase.cs +++ b/LibGit2Sharp/ObjectDatabase.cs @@ -489,9 +489,9 @@ public virtual string ShortenObjectId(GitObject gitObject, int minLength) if (minLength <= 0 || minLength > ObjectId.HexSize) { - throw new ArgumentOutOfRangeException("minLength", + throw new ArgumentOutOfRangeException("minLength", minLength, - string.Format("Expected value should be greater than zero and less than or equal to {0}.", + string.Format("Expected value should be greater than zero and less than or equal to {0}.", ObjectId.HexSize)); } diff --git a/LibGit2Sharp/ObjectId.cs b/LibGit2Sharp/ObjectId.cs index f93817a48..8c4290741 100644 --- a/LibGit2Sharp/ObjectId.cs +++ b/LibGit2Sharp/ObjectId.cs @@ -297,9 +297,9 @@ 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, + throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, + "'{0}' is not a valid object identifier. Its length should be {1}.", + objectId, HexSize), "objectId"); } diff --git a/LibGit2Sharp/OdbBackend.cs b/LibGit2Sharp/OdbBackend.cs index 58b5f60b4..d96e15909 100644 --- a/LibGit2Sharp/OdbBackend.cs +++ b/LibGit2Sharp/OdbBackend.cs @@ -637,7 +637,7 @@ internal static long ConverToLong(UIntPtr len) { throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Provided length ({0}) exceeds long.MaxValue ({1}).", - len.ToUInt64(), + len.ToUInt64(), long.MaxValue)); } diff --git a/LibGit2Sharp/Rebase.cs b/LibGit2Sharp/Rebase.cs index 08836d3f8..88bdf2020 100644 --- a/LibGit2Sharp/Rebase.cs +++ b/LibGit2Sharp/Rebase.cs @@ -91,7 +91,7 @@ public virtual RebaseResult Start(Branch branch, Branch upstream, Branch onto, I this.repository.Refs.RetrieveReferencePtr(b.CanonicalName); }; - Func AnnotatedCommitHandleFromRefHandle = + Func AnnotatedCommitHandleFromRefHandle = (ReferenceSafeHandle refHandle) => { return (refHandle == null) ? @@ -273,7 +273,7 @@ public virtual RebaseStepInfo GetStepInfo(long stepIndex) } /// - /// + /// /// /// public virtual long GetCurrentStepIndex() @@ -290,7 +290,7 @@ public virtual long GetCurrentStepIndex() } /// - /// + /// /// /// public virtual long GetTotalStepCount() diff --git a/LibGit2Sharp/RebaseOperationImpl.cs b/LibGit2Sharp/RebaseOperationImpl.cs index 6b7a2cfad..50f0c7445 100644 --- a/LibGit2Sharp/RebaseOperationImpl.cs +++ b/LibGit2Sharp/RebaseOperationImpl.cs @@ -237,7 +237,7 @@ private static RebaseProgress NextRebaseStep( current = stepToApplyIndex, total = totalStepCount, }; - + return progress; } diff --git a/LibGit2Sharp/RebaseResult.cs b/LibGit2Sharp/RebaseResult.cs index 48f61c1b1..bee2254af 100644 --- a/LibGit2Sharp/RebaseResult.cs +++ b/LibGit2Sharp/RebaseResult.cs @@ -26,7 +26,7 @@ public enum RebaseStatus /// Stop, }; - + /// /// Information on a rebase operation. /// diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs index 297426501..d1a286e26 100644 --- a/LibGit2Sharp/Reference.cs +++ b/LibGit2Sharp/Reference.cs @@ -231,8 +231,8 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0} => \"{1}\"", - CanonicalName, + "{0} => \"{1}\"", + CanonicalName, TargetIdentifier); } } diff --git a/LibGit2Sharp/ReferenceWrapper.cs b/LibGit2Sharp/ReferenceWrapper.cs index 391ff3cc0..471dc1ede 100644 --- a/LibGit2Sharp/ReferenceWrapper.cs +++ b/LibGit2Sharp/ReferenceWrapper.cs @@ -166,8 +166,8 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, "{0} => \"{1}\"", CanonicalName, - (TargetObject != null) - ? TargetObject.Id.ToString(7) + (TargetObject != null) + ? TargetObject.Id.ToString(7) : "?"); } } diff --git a/LibGit2Sharp/RemoteCallbacks.cs b/LibGit2Sharp/RemoteCallbacks.cs index 3f7342ca4..42037a22e 100644 --- a/LibGit2Sharp/RemoteCallbacks.cs +++ b/LibGit2Sharp/RemoteCallbacks.cs @@ -59,7 +59,7 @@ internal RemoteCallbacks(FetchOptionsBase fetchOptions) private readonly UpdateTipsHandler UpdateTips; /// - /// PushStatusError callback. It will be called when the libgit2 push_update_reference returns a non null status message, + /// PushStatusError callback. It will be called when the libgit2 push_update_reference returns a non null status message, /// which means that the update was rejected by the remote server. /// private readonly PushStatusErrorHandler PushStatusError; @@ -266,10 +266,10 @@ private int GitPackbuilderProgressHandler(int stage, uint current, uint total, I } private int GitCredentialHandler( - out IntPtr ptr, - IntPtr cUrl, - IntPtr usernameFromUrl, - GitCredentialType credTypes, + out IntPtr ptr, + IntPtr cUrl, + IntPtr usernameFromUrl, + GitCredentialType credTypes, IntPtr payload) { string url = LaxUtf8Marshaler.FromNative(cUrl); diff --git a/LibGit2Sharp/RepositoryExtensions.cs b/LibGit2Sharp/RepositoryExtensions.cs index f0c88ae23..5aa1fc067 100644 --- a/LibGit2Sharp/RepositoryExtensions.cs +++ b/LibGit2Sharp/RepositoryExtensions.cs @@ -219,6 +219,7 @@ private static Commit LookUpCommit(IRepository repository, string committish) /// The being worked with. /// The description of why a change was made to the repository. /// The generated . + [Obsolete("This method will be removed in the next release. Please use Commit(string, Signature, Signature) instead.")] public static Commit Commit(this IRepository repository, string message) { return repository.Commit(message, (CommitOptions)null); @@ -234,6 +235,7 @@ public static Commit Commit(this IRepository repository, string message) /// The description of why a change was made to the repository. /// The that specify the commit behavior. /// The generated . + [Obsolete("This method will be removed in the next release. Please use Commit(string, Signature, Signature, CommitOptions) instead.")] public static Commit Commit(this IRepository repository, string message, CommitOptions options) { Signature author = repository.Config.BuildSignatureOrThrow(DateTimeOffset.Now); @@ -251,12 +253,12 @@ public static Commit Commit(this IRepository repository, string message, CommitO /// The of who made the change. /// The description of why a change was made to the repository. /// The generated . + [Obsolete("This method will be removed in the next release. Please use Commit(string, Signature, Signature) instead.")] public static Commit Commit(this IRepository repository, string message, Signature author) { return repository.Commit(message, author, (CommitOptions)null); } - /// /// Stores the content of the as a new into the repository. /// The tip of the will be used as the parent of this new Commit. @@ -268,6 +270,7 @@ public static Commit Commit(this IRepository repository, string message, Signatu /// The description of why a change was made to the repository. /// The that specify the commit behavior. /// The generated . + [Obsolete("This method will be removed in the next release. Please use Commit(string, Signature, Signature, CommitOptions) instead.")] public static Commit Commit(this IRepository repository, string message, Signature author, CommitOptions options) { Signature committer = repository.Config.BuildSignatureOrThrow(DateTimeOffset.Now); @@ -275,6 +278,21 @@ public static Commit Commit(this IRepository repository, string message, Signatu return repository.Commit(message, author, committer, options); } + /// + /// Stores the content of the as a new into the repository. + /// The tip of the will be used as the parent of this new Commit. + /// Once the commit is created, the will move forward to point at it. + /// + /// The being worked with. + /// The description of why a change was made to the repository. + /// The of who made the change. + /// The of who added the change to the repository. + /// The generated . + public static Commit Commit(this IRepository repository, string message, Signature author, Signature committer) + { + return repository.Commit(message, author, committer, default(CommitOptions)); + } + /// /// Fetch from the specified remote. /// @@ -357,7 +375,7 @@ 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, + normalizedPath, repo.Info.WorkingDirectory)); } @@ -602,21 +620,6 @@ public static void Reset(this IRepository repository, Commit commit) repository.Index.Replace(commit, null, null); } - /// - /// Stores the content of the as a new into the repository. - /// The tip of the will be used as the parent of this new Commit. - /// Once the commit is created, the will move forward to point at it. - /// - /// The being worked with. - /// The description of why a change was made to the repository. - /// The of who made the change. - /// The of who added the change to the repository. - /// The generated . - public static Commit Commit(this IRepository repository, string message, Signature author, Signature committer) - { - return repository.Commit(message, author, committer, null); - } - /// /// Find where each line of a file originated. /// diff --git a/LibGit2Sharp/SymbolicReference.cs b/LibGit2Sharp/SymbolicReference.cs index f4ad5bd86..4615389e7 100644 --- a/LibGit2Sharp/SymbolicReference.cs +++ b/LibGit2Sharp/SymbolicReference.cs @@ -46,10 +46,10 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, "{0} => {1} => \"{2}\"", - CanonicalName, + CanonicalName, TargetIdentifier, - (Target != null) - ? Target.TargetIdentifier + (Target != null) + ? Target.TargetIdentifier : "?"); } } diff --git a/LibGit2Sharp/TagAnnotation.cs b/LibGit2Sharp/TagAnnotation.cs index 96ef697c0..66a84d556 100644 --- a/LibGit2Sharp/TagAnnotation.cs +++ b/LibGit2Sharp/TagAnnotation.cs @@ -23,11 +23,11 @@ internal TagAnnotation(Repository repo, ObjectId id) : base(repo, id) { lazyName = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_tag_name); - lazyTarget = GitObjectLazyGroup.Singleton(repo, + lazyTarget = GitObjectLazyGroup.Singleton(repo, id, - obj => BuildFrom(repo, - Proxy.git_tag_target_id(obj), - Proxy.git_tag_target_type(obj), + obj => BuildFrom(repo, + Proxy.git_tag_target_id(obj), + Proxy.git_tag_target_type(obj), null)); group = new GitObjectLazyGroup(repo, id); diff --git a/LibGit2Sharp/TarArchiver.cs b/LibGit2Sharp/TarArchiver.cs index 5b2d753ea..3c9ecdd51 100644 --- a/LibGit2Sharp/TarArchiver.cs +++ b/LibGit2Sharp/TarArchiver.cs @@ -100,9 +100,9 @@ protected override void AddTreeEntry(string path, TreeEntry entry, DateTimeOffse } break; default: - throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, - "Unsupported file mode: {0} (sha1: {1}).", - entry.Mode, + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, + "Unsupported file mode: {0} (sha1: {1}).", + entry.Mode, entry.TargetId.Sha)); } } @@ -111,20 +111,20 @@ private void WriteStream(string path, TreeEntry entry, DateTimeOffset modificati { using (Stream contentStream = streamer()) { - writer.Write(path, - contentStream, + writer.Write(path, + contentStream, modificationTime, - (entry.Mode == Mode.ExecutableFile) - ? "775".OctalToInt32() + (entry.Mode == Mode.ExecutableFile) + ? "775".OctalToInt32() : "664".OctalToInt32(), - "0", - "0", - '0', - "root", - "root", - "0", - "0", - entry.TargetId.Sha, + "0", + "0", + '0', + "root", + "root", + "0", + "0", + entry.TargetId.Sha, false); } } diff --git a/LibGit2Sharp/Tree.cs b/LibGit2Sharp/Tree.cs index 9ef5f1e8f..08e867d84 100644 --- a/LibGit2Sharp/Tree.cs +++ b/LibGit2Sharp/Tree.cs @@ -107,8 +107,8 @@ private string DebuggerDisplay get { return string.Format(CultureInfo.InvariantCulture, - "{0}, Count = {1}", - Id.ToString(7), + "{0}, Count = {1}", + Id.ToString(7), Count); } } diff --git a/LibGit2Sharp/TreeChanges.cs b/LibGit2Sharp/TreeChanges.cs index 0e0d54c0e..39a0097ee 100644 --- a/LibGit2Sharp/TreeChanges.cs +++ b/LibGit2Sharp/TreeChanges.cs @@ -162,11 +162,11 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, "+{0} ~{1} -{2} \u00B1{3} R{4} C{5}", - Added.Count(), - Modified.Count(), + Added.Count(), + Modified.Count(), Deleted.Count(), - TypeChanged.Count(), - Renamed.Count(), + TypeChanged.Count(), + Renamed.Count(), Copied.Count()); } } diff --git a/LibGit2Sharp/TreeEntryChanges.cs b/LibGit2Sharp/TreeEntryChanges.cs index f683a312d..4d57b8e50 100644 --- a/LibGit2Sharp/TreeEntryChanges.cs +++ b/LibGit2Sharp/TreeEntryChanges.cs @@ -95,9 +95,9 @@ private string DebuggerDisplay { return string.Format(CultureInfo.InvariantCulture, "Path = {0}, File {1}", - !string.IsNullOrEmpty(Path) - ? Path - : OldPath, + !string.IsNullOrEmpty(Path) + ? Path + : OldPath, Status); } } diff --git a/LibGit2Sharp/TreeEntryTargetType.cs b/LibGit2Sharp/TreeEntryTargetType.cs index 46ceb7d92..181708ec7 100644 --- a/LibGit2Sharp/TreeEntryTargetType.cs +++ b/LibGit2Sharp/TreeEntryTargetType.cs @@ -38,8 +38,8 @@ public static GitObjectType ToGitObjectType(this TreeEntryTargetType type) return GitObjectType.Blob; default: - throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, - "Cannot map {0} to a GitObjectType.", + throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, + "Cannot map {0} to a GitObjectType.", type)); } }