Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Dahlby <dahlbyk@gmail.com>2013-02-20 00:19:24 +0400
committernulltoken <emeric.fermas@gmail.com>2013-03-18 00:17:31 +0400
commit020e14a7e031539f85e9ab3a9ce7ebf8bfdeb187 (patch)
tree3b403d81096efcc4d634c9e107967d2232477607 /LibGit2Sharp/Diff.cs
parenta187d2e5fef360db21b4a4ede050600d4aed1e48 (diff)
Respect core.ignorecase in BuildRelativePathFrom()
Fixes #214
Diffstat (limited to 'LibGit2Sharp/Diff.cs')
-rw-r--r--LibGit2Sharp/Diff.cs24
1 files changed, 1 insertions, 23 deletions
diff --git a/LibGit2Sharp/Diff.cs b/LibGit2Sharp/Diff.cs
index 6b62d71f..41806da4 100644
--- a/LibGit2Sharp/Diff.cs
+++ b/LibGit2Sharp/Diff.cs
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
using LibGit2Sharp.Core;
using LibGit2Sharp.Core.Compat;
using LibGit2Sharp.Core.Handles;
@@ -52,7 +50,7 @@ namespace LibGit2Sharp
throw new ArgumentException("At least one provided path is either null or empty.", "paths");
}
- filePaths.Add(BuildRelativePathFrom(repo, path));
+ filePaths.Add(repo.BuildRelativePathFrom(path));
}
if (filePaths.Count == 0)
@@ -63,26 +61,6 @@ namespace LibGit2Sharp
return filePaths.ToArray();
}
- private static string BuildRelativePathFrom(Repository repo, string path)
- {
- //TODO: To be removed when libgit2 natively implements this
- if (!Path.IsPathRooted(path))
- {
- return path;
- }
-
- string normalizedPath = Path.GetFullPath(path);
-
- if (!normalizedPath.StartsWith(repo.Info.WorkingDirectory, StringComparison.Ordinal))
- {
- throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
- "Unable to process file '{0}'. This absolute filepath escapes out of the working directory of the repository ('{1}').",
- normalizedPath, repo.Info.WorkingDirectory));
- }
-
- return normalizedPath.Substring(repo.Info.WorkingDirectory.Length);
- }
-
/// <summary>
/// Needed for mocking purposes.
/// </summary>