mirror of
https://github.com/gitui-org/gitui.git
synced 2026-10-12 02:14:16 +00:00
fix ci
This commit is contained in:
@@ -344,7 +344,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Set up Homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
uses: Homebrew/actions/setup-homebrew@main
|
||||
|
||||
- name: Install stable Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::error::Result;
|
||||
use git2::Repository;
|
||||
use scopetime::scope_time;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::str::FromStr;
|
||||
|
||||
use super::{repository::repo, RepoPath};
|
||||
|
||||
@@ -73,11 +74,9 @@ pub enum PushDefaultStrategyConfig {
|
||||
Matching,
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a str> for PushDefaultStrategyConfig {
|
||||
type Error = crate::Error;
|
||||
fn try_from(
|
||||
value: &'a str,
|
||||
) -> std::result::Result<Self, Self::Error> {
|
||||
impl FromStr for PushDefaultStrategyConfig {
|
||||
type Err = crate::Error;
|
||||
fn from_str(value: &str) -> std::result::Result<Self, Self::Err> {
|
||||
match value {
|
||||
"nothing" => Ok(Self::Nothing),
|
||||
"current" => Ok(Self::Current),
|
||||
@@ -96,9 +95,7 @@ pub fn push_default_strategy_config_repo(
|
||||
) -> Result<PushDefaultStrategyConfig> {
|
||||
(get_config_string_repo(repo, "push.default")?).map_or_else(
|
||||
|| Ok(PushDefaultStrategyConfig::default()),
|
||||
|entry_str| {
|
||||
PushDefaultStrategyConfig::try_from(entry_str.as_str())
|
||||
},
|
||||
|entry_str| entry_str.parse(),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -21,11 +21,11 @@ use std::{
|
||||
bitflags! {
|
||||
/// flags defining what part of the app need to update
|
||||
pub struct NeedsUpdate: u32 {
|
||||
/// app::update
|
||||
/// `app::update`
|
||||
const ALL = 0b001;
|
||||
/// diff may have changed (app::update_diff)
|
||||
/// diff may have changed (`app::update_diff`)
|
||||
const DIFF = 0b010;
|
||||
/// commands might need updating (app::update_commands)
|
||||
/// commands might need updating (`app::update_commands`)
|
||||
const COMMANDS = 0b100;
|
||||
/// branches have changed
|
||||
const BRANCHES = 0b1000;
|
||||
|
||||
Reference in New Issue
Block a user