mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 10:07:28 +00:00
tests: remove obsolete workaround for WorkingCopy
reading from $HOME
Since d56ae79d3f
, `WorkingCopy` no longer reads `.gitignores`
directly from `$HOME/.gitignore`, so we don't need the workaround to
prevent it in the tests.
This commit is contained in:
parent
cb2fcde560
commit
c366795d80
2 changed files with 0 additions and 15 deletions
|
@ -42,14 +42,6 @@ pub fn new_temp_dir() -> TempDir {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_user_home() -> TempDir {
|
|
||||||
// Set $HOME to some arbitrary place so libgit2 doesn't use ~/.gitignore
|
|
||||||
// of the person running the tests.
|
|
||||||
let home_dir = new_temp_dir();
|
|
||||||
std::env::set_var("HOME", home_dir.path());
|
|
||||||
home_dir
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn user_settings() -> UserSettings {
|
pub fn user_settings() -> UserSettings {
|
||||||
let config = config::Config::builder()
|
let config = config::Config::builder()
|
||||||
.set_override("user.name", "Test User")
|
.set_override("user.name", "Test User")
|
||||||
|
|
|
@ -396,7 +396,6 @@ fn test_checkout_discard() {
|
||||||
fn test_snapshot_racy_timestamps(use_git: bool) {
|
fn test_snapshot_racy_timestamps(use_git: bool) {
|
||||||
// Tests that file modifications are detected even if they happen the same
|
// Tests that file modifications are detected even if they happen the same
|
||||||
// millisecond as the updated working copy state.
|
// millisecond as the updated working copy state.
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
@ -428,7 +427,6 @@ fn test_snapshot_racy_timestamps(use_git: bool) {
|
||||||
fn test_snapshot_special_file() {
|
fn test_snapshot_special_file() {
|
||||||
// Tests that we ignore when special files (such as sockets and pipes) exist on
|
// Tests that we ignore when special files (such as sockets and pipes) exist on
|
||||||
// disk.
|
// disk.
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, false);
|
let mut test_workspace = TestWorkspace::init(&settings, false);
|
||||||
let workspace_root = test_workspace.workspace.workspace_root().clone();
|
let workspace_root = test_workspace.workspace.workspace_root().clone();
|
||||||
|
@ -485,7 +483,6 @@ fn test_snapshot_special_file() {
|
||||||
fn test_gitignores(use_git: bool) {
|
fn test_gitignores(use_git: bool) {
|
||||||
// Tests that .gitignore files are respected.
|
// Tests that .gitignore files are respected.
|
||||||
|
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
@ -561,7 +558,6 @@ fn test_gitignores_checkout_never_overwrites_ignored(use_git: bool) {
|
||||||
// Tests that a .gitignore'd file doesn't get overwritten if check out a commit
|
// Tests that a .gitignore'd file doesn't get overwritten if check out a commit
|
||||||
// where the file is tracked.
|
// where the file is tracked.
|
||||||
|
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
@ -599,7 +595,6 @@ fn test_gitignores_ignored_directory_already_tracked(use_git: bool) {
|
||||||
// Tests that a .gitignore'd directory that already has a tracked file in it
|
// Tests that a .gitignore'd directory that already has a tracked file in it
|
||||||
// does not get removed when snapshotting the working directory.
|
// does not get removed when snapshotting the working directory.
|
||||||
|
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
@ -643,7 +638,6 @@ fn test_dotgit_ignored(use_git: bool) {
|
||||||
// Tests that .git directories and files are always ignored (we could accept
|
// Tests that .git directories and files are always ignored (we could accept
|
||||||
// them if the backend is not git).
|
// them if the backend is not git).
|
||||||
|
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
@ -680,7 +674,6 @@ fn test_dotgit_ignored(use_git: bool) {
|
||||||
#[test_case(false ; "local backend")]
|
#[test_case(false ; "local backend")]
|
||||||
#[test_case(true ; "git backend")]
|
#[test_case(true ; "git backend")]
|
||||||
fn test_existing_directory_symlink(use_git: bool) {
|
fn test_existing_directory_symlink(use_git: bool) {
|
||||||
let _home_dir = testutils::new_user_home();
|
|
||||||
let settings = testutils::user_settings();
|
let settings = testutils::user_settings();
|
||||||
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
let mut test_workspace = TestWorkspace::init(&settings, use_git);
|
||||||
let repo = &test_workspace.repo;
|
let repo = &test_workspace.repo;
|
||||||
|
|
Loading…
Reference in a new issue