eden/fs/inodes/test/DiffTest.cpp
// Make sure the code ignores .gitignore directories
Make sure the code ignores .gitignore directories
Make sure the code ignores . gitignore directories
TEST(DiffTest, ignoreFileIsDirectory) {
  DiffTest test({
      {".gitignore", "1.txt\nignore.txt\n"},
      {"a/b.txt", "test\n"},
      {"a/.gitignore/b.txt", "test\n"},
      {"a/b/c.txt", "test\n"},
  });
  test.getMount().addFile("a/b/1.txt", "new\n");
  auto result = test.diff();
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(result.getUntracked(), UnorderedElementsAre());
  EXPECT_THAT(result.getIgnored(), UnorderedElementsAre());
  EXPECT_THAT(result.getRemoved(), UnorderedElementsAre());
  EXPECT_THAT(result.getModified(), UnorderedElementsAre());
  result = test.diff(true);
  EXPECT_THAT(result.getErrors(), UnorderedElementsAre());
  EXPECT_THAT(result.getUntracked(), UnorderedElementsAre());
  EXPECT_THAT(
      result.getIgnored(), UnorderedElementsAre(RelativePath{"a/b/1.txt"}));
  EXPECT_THAT(result.getRemoved(), UnorderedElementsAre());
  EXPECT_THAT(result.getModified(), UnorderedElementsAre());
}
TEST ( DiffTest , ignoreFileIsDirectory ) { DiffTest test ( { { " " , " \n \n " } , { " " , " \n " } , { " " , " \n " } , { " " , " \n " } , } ) ; test . getMount ( ) . addFile ( " " , " \n " ) ; auto result = test . diff ( ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getUntracked ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getRemoved ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getModified ( ) , UnorderedElementsAre ( ) ) ; result = test . diff ( true ) ; EXPECT_THAT ( result . getErrors ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getUntracked ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getIgnored ( ) , UnorderedElementsAre ( RelativePath { " " } ) ) ; EXPECT_THAT ( result . getRemoved ( ) , UnorderedElementsAre ( ) ) ; EXPECT_THAT ( result . getModified ( ) , UnorderedElementsAre ( ) ) ; }
Make sure the code ignores .gitignore directories
Make sure the code ignores . gitignore directories