-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1752 from GitoxideLabs/git-shell
git login shell
- Loading branch information
Showing
30 changed files
with
141 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#[test] | ||
fn exe_invocation() { | ||
let actual = gix_path::env::exe_invocation(); | ||
assert!( | ||
!actual.as_os_str().is_empty(), | ||
"it finds something as long as git is installed somewhere on the system (or a default location)" | ||
); | ||
} | ||
|
||
#[test] | ||
fn login_shell() { | ||
// On CI, the $SHELL variable isn't necessarily set. Maybe other ways to get the login shell should be used then. | ||
if !gix_testtools::is_ci::cached() { | ||
assert!(gix_path::env::login_shell() | ||
.expect("There should always be the notion of a shell used by git") | ||
.exists()); | ||
} | ||
} | ||
|
||
#[test] | ||
fn installation_config() { | ||
assert_ne!( | ||
gix_path::env::installation_config().map(|p| p.components().count()), | ||
gix_path::env::installation_config_prefix().map(|p| p.components().count()), | ||
"the prefix is a bit shorter than the installation config path itself" | ||
); | ||
} | ||
|
||
#[test] | ||
fn system_prefix() { | ||
assert_ne!( | ||
gix_path::env::system_prefix(), | ||
None, | ||
"git should be present when running tests" | ||
); | ||
} | ||
|
||
#[test] | ||
fn home_dir() { | ||
assert_ne!( | ||
gix_path::env::home_dir(), | ||
None, | ||
"we find a home on every system these tests execute" | ||
); | ||
} | ||
|
||
mod xdg_config { | ||
use std::ffi::OsStr; | ||
|
||
#[test] | ||
fn prefers_xdg_config_bases() { | ||
let actual = gix_path::env::xdg_config("test", &mut |n| { | ||
(n == OsStr::new("XDG_CONFIG_HOME")).then(|| "marker".into()) | ||
}) | ||
.expect("set"); | ||
#[cfg(unix)] | ||
assert_eq!(actual.to_str(), Some("marker/git/test")); | ||
#[cfg(windows)] | ||
assert_eq!(actual.to_str(), Some("marker\\git\\test")); | ||
} | ||
|
||
#[test] | ||
fn falls_back_to_home() { | ||
let actual = gix_path::env::xdg_config("test", &mut |n| (n == OsStr::new("HOME")).then(|| "marker".into())) | ||
.expect("set"); | ||
#[cfg(unix)] | ||
assert_eq!(actual.to_str(), Some("marker/.config/git/test")); | ||
#[cfg(windows)] | ||
assert_eq!(actual.to_str(), Some("marker\\.config\\git\\test")); | ||
} | ||
} |
Oops, something went wrong.