Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var commitRange = process.env.TRAVIS_COMMIT_RANGE
var range = (commitRange || '').split(/\.{3}/)
if (!base || !commitRange || range.length !== 2) {
return next()
}
if (commitRange !== previousRange) {
cache = {}
previousRange = commitRange
}
if (own.call(cache, base)) {
tick(cache[base])
} else {
findUp.one('.git', file.dirname, ongit)
}
function ongit(err, git) {
/* istanbul ignore if - Never happens */
if (err) {
return next(err)
}
/* istanbul ignore if - Not testable in a Git repo… */
if (!git) {
return next(new Error('Not in a git repository'))
}
cache[base] = git.dirname
tick(git.dirname)
}
files.push(toFile(glob));
given.push(glob);
try {
if (!stat(glob).isFile()) {
files.pop();
given.pop();
}
} catch (err) { /* Empty. */ }
});
/*
* Search for an ignore file.
*/
findUp.one(IGNORE, function (err, file) {
var ignore = [];
try {
ignore = file && loadIgnore(file.filePath());
} catch (err) { /* Empty. */ }
ignore = defaultIgnore.concat(ignore || []);
findDown.all(filterFactory(ignore, given), filePaths, processFactory(files));
});
}, bail);