Remove unused config no-meta-data (see #281, #283).

This commit is contained in:
Matt Burke
2013-01-10 09:24:41 -05:00
parent 8e4c367e9c
commit 4c2ab71e75
6 changed files with 2 additions and 36 deletions
-4
View File
@@ -17,8 +17,6 @@ namespace Sep.Git.Tfs.Commands
{
{ "ignore-regex=", "a regex of files to ignore",
v => IgnoreRegex = v },
{ "no-metadata", "leave out the 'git-tfs-id:' tag in commit messages\nUse this when you're exporting from TFS and don't need to put data back into TFS.",
v => NoMetaData = v != null },
{ "u|username=", "TFS username",
v => Username = v },
{ "p|password=", "TFS password",
@@ -29,8 +27,6 @@ namespace Sep.Git.Tfs.Commands
public string IgnoreRegex { get; set; }
public bool NoMetaData { get; set; }
public string Username { get; set; }
public string Password { get; set; }
-3
View File
@@ -28,8 +28,6 @@ namespace Sep.Git.Tfs.Core
remote.Password = entry.Value;
else if (key == "ignore-paths")
remote.IgnoreRegex = entry.Value;
else if (key == "no-meta-data")
remote.NoMetaData = entry.Value.ToLower() != "false";
else if (key == "legacy-urls")
remote.Aliases = entry.Value.Split(',');
else if (key == "autotag")
@@ -49,7 +47,6 @@ namespace Sep.Git.Tfs.Core
yield return c(prefix + "username", remote.Username);
yield return c(prefix + "password", remote.Password);
yield return c(prefix + "ignore-paths", remote.IgnoreRegex);
yield return c(prefix + "no-meta-data", remote.NoMetaData ? "true" : null);
yield return c(prefix + "legacy-urls", remote.Aliases == null ? null : string.Join(",", remote.Aliases));
yield return c(prefix + "autotag", remote.Autotag ? "true" : null);
}
+2 -3
View File
@@ -14,14 +14,13 @@ namespace Sep.Git.Tfs.Core
public string Username { get; set; }
public string Password { get; set; }
public string IgnoreRegex { get; set; }
public bool NoMetaData { get; set; }
public IEnumerable<string> Aliases { get; set; }
public bool Autotag { get; set; }
public RemoteOptions RemoteOptions
{
get { return new RemoteOptions { IgnoreRegex = IgnoreRegex, NoMetaData = NoMetaData, Username = Username, Password = Password }; }
set { IgnoreRegex = value.IgnoreRegex; NoMetaData = value.NoMetaData; Username = value.Username; Password = value.Password; }
get { return new RemoteOptions { IgnoreRegex = IgnoreRegex, Username = Username, Password = Password }; }
set { IgnoreRegex = value.IgnoreRegex; Username = value.Username; Password = value.Password; }
}
}
}
@@ -33,7 +33,6 @@ namespace Sep.Git.Tfs.Test.Core
AssertContainsConfig("tfs-remote.default.repository", "$/Project", config);
AssertContainsConfig("tfs-remote.default.username", null, config);
AssertContainsConfig("tfs-remote.default.password", null, config);
AssertContainsConfig("tfs-remote.default.no-meta-data", null, config);
AssertContainsConfig("tfs-remote.default.ignore-paths", null, config);
AssertContainsConfig("tfs-remote.default.legacy-urls", null, config);
AssertContainsConfig("tfs-remote.default.autotag", null, config);
@@ -49,7 +48,6 @@ namespace Sep.Git.Tfs.Test.Core
Username = "user",
Password = "pass",
IgnoreRegex = "abc",
NoMetaData = true,
Autotag = true,
Aliases = new string[] { "http://abc", "http://def" },
};
@@ -58,7 +56,6 @@ namespace Sep.Git.Tfs.Test.Core
AssertContainsConfig("tfs-remote.default.repository", "$/Project", config);
AssertContainsConfig("tfs-remote.default.username", "user", config);
AssertContainsConfig("tfs-remote.default.password", "pass", config);
AssertContainsConfig("tfs-remote.default.no-meta-data", "true", config);
AssertContainsConfig("tfs-remote.default.ignore-paths", "abc", config);
AssertContainsConfig("tfs-remote.default.legacy-urls", "http://abc,http://def", config);
AssertContainsConfig("tfs-remote.default.autotag", "true", config);
@@ -46,7 +46,6 @@ namespace Sep.Git.Tfs.Test.Core
Assert.Null(_firstRemote.Username);
Assert.Null(_firstRemote.Password);
Assert.Null(_firstRemote.IgnoreRegex);
Assert.False(_firstRemote.NoMetaData);
}
void SetUpCompleteRemote()
@@ -54,7 +53,6 @@ namespace Sep.Git.Tfs.Test.Core
SetUpMinimalRemote();
_config["tfs-remote.default.username"] = "theuser";
_config["tfs-remote.default.password"] = "thepassword";
_config["tfs-remote.default.no-meta-data"] = "true";
_config["tfs-remote.default.ignore-paths"] = "ignorethis.zip";
_config["tfs-remote.default.legacy-urls"] = "http://old:8080/,http://other/";
_config["tfs-remote.default.autotag"] = "true";
@@ -70,25 +68,8 @@ namespace Sep.Git.Tfs.Test.Core
Assert.Equal("theuser", _firstRemote.Username);
Assert.Equal("thepassword", _firstRemote.Password);
Assert.Equal("ignorethis.zip", _firstRemote.IgnoreRegex);
Assert.True(_firstRemote.NoMetaData);
Assert.Equal(new string[] { "http://old:8080/", "http://other/" }, _firstRemote.Aliases);
Assert.True(_firstRemote.Autotag);
}
[Fact]
public void NoMetaDataCanBe_1()
{
SetUpMinimalRemote();
_config["tfs-remote.default.no-meta-data"] = "1";
Assert.True(_firstRemote.NoMetaData);
}
[Fact]
public void NoMetaDataCanBe_false()
{
SetUpMinimalRemote();
_config["tfs-remote.default.no-meta-data"] = "false";
Assert.False(_firstRemote.NoMetaData);
}
}
}
-4
View File
@@ -51,7 +51,3 @@ key for the remote `default` is `tfs-remote.default.url`.
can be set to `true` to make git-tfs create a tag for each
TFS commit. This is disabled by default, because creating
a lot of tags will slow down your git operations.
* `no-meta-data`
does nothing. It formerly controlled whether TFS meta-data
(the `git-tfs-id` field) was added to commit messages during
fetch.