public string GetSignature() { if (string.IsNullOrEmpty(signature_) == false) { return(signature_); } signature_ = GitWrapper.GetSignature(); return(signature_); }
// return true if selected yes and initialized git public static bool AskAndGitInit(string directory) { string message = $"Invalid git root directory:{directory}\n\n"; message += $"Initialize as GIT repository?\n\n"; message += $"This will execute 'git init' and create {directory}\\.git directory"; if (ShowMessageWithYesNo(message) != MessageBoxResult.Yes) { return(false); } GitWrapper gitWrapper = new GitWrapper(directory, null); gitWrapper.Init(); return(true); }
public static bool IsValidGitDirectory(string directory) { if (string.IsNullOrEmpty(directory)) { return(false); } if (Directory.Exists(directory) == false) { return(false); } if (Directory.Exists(Path.Combine(directory, ".git")) == false) { return(false); } GitWrapper git_wrapper = new GitWrapper(directory, null); if (git_wrapper.IsValidGitDirectory() == false) { return(false); } return(true); }
public void OnChangeDirectory(object parameter) { if (String.IsNullOrEmpty(Directory)) { string msg = "Directory is empty"; Service.GetInstance().ShowMsg(msg); return; } if (System.IO.Directory.Exists(Directory) == false) { string msg = "Directory does not exist"; Service.GetInstance().ShowMsg(msg); return; } if (LibGit2Sharp.Repository.IsValid(Directory) == false) { string msg = "Directory is not a valid git directory"; Service.GetInstance().ShowMsg(msg); return; } git_ = new GitWrapper(Directory); Service.GetInstance().SetRootPath(Directory); Refresh(); DirectoryUsed(Directory); }