Implement embedded Git synchronization TUI
This commit is contained in:
@@ -71,6 +71,18 @@ impl Config {
|
||||
&self.git_remotes
|
||||
}
|
||||
|
||||
/// Select a configured remote by name, or the configured default (first
|
||||
/// remote) when no name was requested.
|
||||
pub fn git_remote(&self, requested: Option<&str>) -> Option<&GitRemote> {
|
||||
match requested {
|
||||
Some(name) => self
|
||||
.git_remotes
|
||||
.iter()
|
||||
.find(|remote| remote.name().as_str() == name),
|
||||
None => self.git_remotes.first(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolve the configured editor, then `$VISUAL`, `$EDITOR`, and finally `vim`.
|
||||
pub fn resolve_editor(&self) -> Result<ResolvedEditor, EditorError> {
|
||||
self.resolve_editor_from(
|
||||
|
||||
Reference in New Issue
Block a user