MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_load_reads_gitignore

Function test_load_reads_gitignore

atomic-repository/src/ignore.rs:509–519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

507
508 #[test]
509 fn test_load_reads_gitignore() {
510 // `load` is the VCS-wide matcher (status, tracking, switch). It must
511 // honor `.gitignore`, because that is the file every project already
512 // uses to exclude build output — and without it `record` walks into
513 // those directories and fails on artifacts nobody meant to version.
514 let temp = TempDir::new().unwrap();
515 std::fs::write(temp.path().join(".gitignore"), "node_modules/\n").unwrap();
516
517 let rules = IgnoreRules::load(temp.path());
518 assert!(rules.is_ignored(Path::new("node_modules/pkg/index.js"), false));
519 }
520
521 #[test]
522 fn test_load_reads_dot_ignore() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected