Compare commits

..

No commits in common. "beb880ed43466bc38dba78bd05704fcb82fe01f7" and "1b51633d4fe897dd34c3106cd2a220229c4762f5" have entirely different histories.

4 changed files with 3 additions and 7 deletions

View file

@ -135,9 +135,6 @@ Default: '>'
.It Ev REMUX_NEW_WINDOW
Provides a default windows name when creating a new session. Unused if empty.
Default: (unset)
.It Ev REMUX_REPO_FILE
The filename to match on when trying to find the root of a repository.
Default: '.git'
.El
.Sh EXIT STATUS
.Bl -tag -Width Ds

View file

@ -5,7 +5,6 @@ pub type EnvVar = (&'static str, &'static str);
pub static ATTACH_SYMBOL: EnvVar = ("REMUX_ATTACH_SYMBOL", "*");
pub static CURRENT_SYMBOL: EnvVar = ("REMUX_CURRENT_SYMBOL", ">");
pub static NEW_WINDOW_NAME: EnvVar = ("REMUX_NEW_WINDOW", "");
pub static REPO_FILE: EnvVar = ("REMUX_REPO_FILE", ".git");
pub static TMUX: &str = "TMUX";

View file

@ -6,7 +6,7 @@ use std::{
use pico_args::Arguments;
use crate::{
env::{ env_var, REPO_FILE, TMUX },
env::TMUX,
error,
flag::Flags,
util::{ find, session_name }
@ -82,7 +82,7 @@ pub struct Repository {
impl Repository {
pub fn find() -> Option<Repository> {
let path = find(&env_var(REPO_FILE), env::current_dir().unwrap());
let path = find(".git", env::current_dir().unwrap());
if let Some(path) = path {
let name = path.file_name().unwrap().to_string_lossy().to_string();
let inner = Repository {

View file

@ -51,7 +51,7 @@ pub fn terminal_enforce() {
}
/// recursively propagate up directories to find a child
pub fn find(target: &str, path: PathBuf) -> Option<PathBuf> {
pub fn find(target: &'static str, path: PathBuf) -> Option<PathBuf> {
if path.join(target).exists() { return Some(path); }
let parent = path.parent();