mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-02-01 18:18:24 +00:00
Git works! Hooray!
This commit is contained in:
parent
e874584a55
commit
9d613016c0
@ -273,6 +273,7 @@ impl Git {
|
|||||||
/// Paths need to be absolute for them to be compared properly, otherwise
|
/// Paths need to be absolute for them to be compared properly, otherwise
|
||||||
/// you’d ask a repo about “./README.md” but it only knows about
|
/// you’d ask a repo about “./README.md” but it only knows about
|
||||||
/// “/vagrant/README.md”, prefixed by the workdir.
|
/// “/vagrant/README.md”, prefixed by the workdir.
|
||||||
|
#[cfg(unix)]
|
||||||
fn reorient(path: &Path) -> PathBuf {
|
fn reorient(path: &Path) -> PathBuf {
|
||||||
use std::env::current_dir;
|
use std::env::current_dir;
|
||||||
|
|
||||||
@ -285,6 +286,14 @@ fn reorient(path: &Path) -> PathBuf {
|
|||||||
path.canonicalize().unwrap_or(path)
|
path.canonicalize().unwrap_or(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
fn reorient(path: &Path) -> PathBuf {
|
||||||
|
let unc_path = path.canonicalize().unwrap();
|
||||||
|
// On Windows UNC path is returned. We need to strip the prefix for it to work.
|
||||||
|
let normal_path = unc_path.as_os_str().to_str().unwrap().trim_left_matches("\\\\?\\");
|
||||||
|
return PathBuf::from(normal_path);
|
||||||
|
}
|
||||||
|
|
||||||
/// The character to display if the file has been modified, but not staged.
|
/// The character to display if the file has been modified, but not staged.
|
||||||
fn working_tree_status(status: git2::Status) -> f::GitStatus {
|
fn working_tree_status(status: git2::Status) -> f::GitStatus {
|
||||||
match status {
|
match status {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user