style: add .editorconfig for code formatting. see issu #25

This commit is contained in:
leo 2024-03-18 09:37:06 +08:00
parent a8eeea4f78
commit 18aaa0a143
225 changed files with 7781 additions and 3911 deletions

View file

@ -1,34 +1,43 @@
using System.Collections.Generic;
using System.IO;
namespace SourceGit.Commands {
public static class Tag {
public static bool Add(string repo, string name, string basedOn, string message) {
namespace SourceGit.Commands
{
public static class Tag
{
public static bool Add(string repo, string name, string basedOn, string message)
{
var cmd = new Command();
cmd.WorkingDirectory = repo;
cmd.Context = repo;
cmd.Args = $"tag -a {name} {basedOn} ";
if (!string.IsNullOrEmpty(message)) {
if (!string.IsNullOrEmpty(message))
{
string tmp = Path.GetTempFileName();
File.WriteAllText(tmp, message);
cmd.Args += $"-F \"{tmp}\"";
} else {
}
else
{
cmd.Args += $"-m {name}";
}
return cmd.Exec();
}
public static bool Delete(string repo, string name, List<Models.Remote> remotes) {
public static bool Delete(string repo, string name, List<Models.Remote> remotes)
{
var cmd = new Command();
cmd.WorkingDirectory = repo;
cmd.Context = repo;
cmd.Args = $"tag --delete {name}";
if (!cmd.Exec()) return false;
if (remotes != null) {
foreach (var r in remotes) {
if (remotes != null)
{
foreach (var r in remotes)
{
new Push(repo, r.Name, name, true).Exec();
}
}
@ -36,4 +45,4 @@ namespace SourceGit.Commands {
return true;
}
}
}
}