eden/fs/inodes/test/DiffTest.cpp
// Test with a .gitignore file in the top-level directory
// and the presence of none, either, or both of system level
// and user specific ignore files
Test with a .gitignore file in the top-level directory
and the presence of none, either, or both of system level
and user specific ignore files
Test with a . gitignore file in the top - level directory and the presence of none either or both of system level and user specific ignore files
TEST(DiffTest, ignoreSystemLevelAndUser) {
  DiffTest test({
      {".gitignore", "/1.txt\nignore.txt\njunk/\n!important.txt\n"},
      {"a/b.txt", "test\n"},
      {"src/x.txt", "test\n"},
      {"src/y.txt", "test\n"},
      {"src/z.txt", "test\n"},
      {"src/foo/bar.txt", "test\n"},
  });
  test.getMount().addFile("skip_global.txt", "new\n");
  test.getMount().addFile("skip_user.txt", "new\n");
  auto result =
      test.diff(true , "skip_global.txt\n", "skip_user.txt\n");
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(
      result.getIgnored(),
      UnorderedElementsAre(
          RelativePath{"skip_global.txt"}, RelativePath{"skip_user.txt"}));
  result = test.diff(true , "", "skip_user.txt\n");
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(
      result.getIgnored(), UnorderedElementsAre(RelativePath{"skip_user.txt"}));
  result = test.diff(true , "skip_global.txt\n", "");
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(
      result.getIgnored(),
      UnorderedElementsAre(RelativePath{"skip_global.txt"}));
  result = test.diff(true , "", "");
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(result.getIgnored(), UnorderedElementsAre());
}
TEST ( DiffTest , ignoreSystemLevelAndUser ) { DiffTest test ( { { " " , " \n \n \n \n " } , { " " , " \n " } , { " " , " \n " } , { " " , " \n " } , { " " , " \n " } , { " " , " \n " } , } ) ; test . getMount ( ) . addFile ( " " , " \n " ) ; test . getMount ( ) . addFile ( " " , " \n " ) ; auto result = test . diff ( true , " \n " , " \n " ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( RelativePath { " " } , RelativePath { " " } ) ) ; result = test . diff ( true , " " , " \n " ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( RelativePath { " " } ) ) ; result = test . diff ( true , " \n " , " " ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( RelativePath { " " } ) ) ; result = test . diff ( true , " " , " " ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( ) ) ; }
Test with a .gitignore file in the top-level directory
and the presence of none, either, or both of system level
and user specific ignore files
Test with a . gitignore file in the top - level directory and the presence of none either or both of system level and user specific ignore files
// Add some untracked files, matching either global or user patterns /* listIgnored */ /* listIgnored */ /* listIgnored */ /* listIgnored */