pub async fn handle_list_dir(
        statusbar_item: Arc<Mutex<Option<StatusBarItem>>>,
        client: ExtensionClient,
        state_id: u8,
        path: String,
    ) {
        let repo = Repository::discover(path);
        if let Ok(repo) = repo {
            if let Ok(head) = repo.head() {
                let branch = head.shorthand();
                if let Some(branch) = branch {
                    if let Some(statusbar_item) = &*statusbar_item.lock().await {
                        statusbar_item.hide().await;
                    }
                    let item = StatusBarItem::new(client.clone(), state_id, branch);
                    item.show().await;
                    *statusbar_item.lock().await = Some(item);
                } else {
                    println!("Can't format head");
                }
            } else {
                println!("Head not found");
            }
        } else {
            println!("Repo not found");
        }
    }
/// Handle ListDir events
/// Note: The errors should be better handled
Handle ListDir events
Note: The errors should be better handled
Handle ListDir events Note : The errors should be better handled
pub async fn handle_list_dir(
        statusbar_item: Arc<Mutex<Option<StatusBarItem>>>,
        client: ExtensionClient,
        state_id: u8,
        path: String,
    ) {
        let repo = Repository::discover(path);
        if let Ok(repo) = repo {
            if let Ok(head) = repo.head() {
                let branch = head.shorthand();
                if let Some(branch) = branch {
                    if let Some(statusbar_item) = &*statusbar_item.lock().await {
                        statusbar_item.hide().await;
                    }
                    let item = StatusBarItem::new(client.clone(), state_id, branch);
                    item.show().await;
                    *statusbar_item.lock().await = Some(item);
                } else {
                    println!("Can't format head");
                }
            } else {
                println!("Head not found");
            }
        } else {
            println!("Repo not found");
        }
    }
pub async fn handle_list_dir ( statusbar_item : Arc < Mutex < Option < StatusBarItem > > > , client : ExtensionClient , state_id : u8 , path : String , ) { let repo = Repository :: discover ( path ) ; if let Ok ( repo ) = repo { if let Ok ( head ) = repo . head ( ) { let branch = head . shorthand ( ) ; if let Some ( branch ) = branch { if let Some ( statusbar_item ) = & * statusbar_item . lock ( ) . await { statusbar_item . hide ( ) . await ; } let item = StatusBarItem :: new ( client . clone ( ) , state_id , branch ) ; item . show ( ) . await ; * statusbar_item . lock ( ) . await = Some ( item ) ; } else { println ! ( " " ) ; } } else { println ! ( " " ) ; } } else { println ! ( " " ) ; } }
Handle ListDir events
Note: The errors should be better handled
Handle ListDir events Note : The errors should be better handled
statusbar_item
Arc<Mutex<Option<StatusBarItem>>>
client
ExtensionClient
state_id
u8
path
String