Disable Gitignore Support

This commit is contained in:
Philippe Miossec
2017-12-14 13:59:42 +01:00
parent bfe4f6a15b
commit 315b2dc2b9
2 changed files with 19 additions and 7 deletions
+9 -2
View File
@@ -19,6 +19,7 @@ namespace GitTfs.Core
private IDictionary<string, IGitTfsRemote> _cachedRemotes;
private readonly Repository _repository;
private readonly RemoteConfigConverter _remoteConfigReader;
private readonly bool _disableGitignoreSupport;
public GitRepository(string gitDir, IContainer container, Globals globals, RemoteConfigConverter remoteConfigReader)
: base(container)
@@ -28,6 +29,12 @@ namespace GitTfs.Core
GitDir = gitDir;
_repository = new Repository(GitDir);
_remoteConfigReader = remoteConfigReader;
var value = GetConfig<string>(GitTfsConstants.DisableGitignoreSupport, null);
bool disableGitignoreSupport;
if (value != null && bool.TryParse(value, out disableGitignoreSupport))
_disableGitignoreSupport = disableGitignoreSupport;
}
~GitRepository()
@@ -721,7 +728,7 @@ namespace GitTfs.Core
var parent = to;
foreach (var gitCommit in commits)
{
if (!gitCommit.Parents.Any(c => c.Sha == parent))
if (gitCommit.Parents.All(c => c.Sha != parent))
return new List<GitCommit>();
parent = gitCommit.Sha;
}
@@ -730,7 +737,7 @@ namespace GitTfs.Core
public bool IsPathIgnored(string relativePath)
{
return _repository.Ignore.IsPathIgnored(relativePath);
return !_disableGitignoreSupport && _repository.Ignore.IsPathIgnored(relativePath);
}
public string CommitGitIgnore(string pathToGitIgnoreFile)
+10 -5
View File
@@ -52,6 +52,14 @@ namespace GitTfs
/// </summary>
public const string RemoteSubtreeFormat = "{0}_subtree/{1}";
public static readonly string MessageForceVersion = Environment.NewLine
+ "Note: If you want to force git-tfs to use another version of the tfs client library,"
+ Environment.NewLine
+ "set the environment variable `GIT_TFS_CLIENT` with the wished version (ie: '2013' for Visual Studio 2013,...)";
public const string LogFileName = "git-tfs_log.txt";
//Git-Tfs config keys
public const string ExportMetadatasConfigKey = GitTfsPrefix + ".export-metadatas";
public const string WorkspaceConfigKey = GitTfsPrefix + ".workspace-dir";
@@ -63,10 +71,7 @@ namespace GitTfs
public const string BatchSize = GitTfsPrefix + ".batch-size";
public static string InitialChangeset = GitTfsPrefix + ".initial-changeset";
public static string MessageForceVersion = Environment.NewLine
+ "Note: If you want to force git-tfs to use another version of the tfs client library,"
+ Environment.NewLine
+ "set the environment variable `GIT_TFS_CLIENT` with the wished version (ie: '2013' for Visual Studio 2013,...)";
public const string LogFileName = "git-tfs_log.txt";
public static string DisableGitignoreSupport = GitTfsPrefix + ".disable-gitignore-support";
}
}