private void SetStashInfo(GitStashInfo gitStashInfo) { foreach (var section in this.GetSections().OfType <GitStashDetailSection>()) { section.StashInfo = gitStashInfo; section.IsVisible = gitStashInfo != null; } }
public static GitStashInfo GetStashDetails(GitStash stash) { GitStashInfo res = null; var cmd = "git"; var args = $"-C \"{stash.GitDirectory}\" stash show {stash.Id}"; ScriptHelper.ExecuteScript(cmd, args, ScriptExecutionSettings.OneOutputStream, s => { res = GitStashInfo.ParseFromCmdResult(s, stash.GitDirectory); EnumerableExtensions.Apply(res.Changes, change => change.Image = FileHelper.GetFileIconForExtensionOrFilename(Path.GetExtension(change.FileName)).ToBitmap().ToImageSource()); res.Stash = stash; }); return(res); }