Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1421)

Unified Diff: sdk/lib/_internal/pub/lib/src/package.dart

Issue 599303002: Don't use .gitignore when determining what to build/serve/run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use .gitignore in dartdoc validator. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index 40e93e10ae14d6d18e76265a7dcb5100d73f0226..af0c750f606e8fe6505e53aaa3a1aa9cd7073d33 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -183,9 +183,13 @@ class Package {
/// [recursive] is true, this will return all files beneath that path;
/// otherwise, it will only return files one level beneath it.
///
+ /// If [useGitIgnore] is passed, this will take the .gitignore rules into
+ /// account if the package's root directory is a Git repository.
+ ///
/// Note that the returned paths won't always be beneath [dir]. To safely
/// convert them to paths relative to the package root, use [relative].
- List<String> listFiles({String beneath, recursive: true}) {
+ List<String> listFiles({String beneath, bool recursive: true,
+ bool useGitIgnore: false}) {
if (beneath == null) {
beneath = dir;
} else {
@@ -200,7 +204,7 @@ class Package {
// path package, since re-parsing a path is very expensive relative to
// string operations.
var files;
- if (git.isInstalled && dirExists(path('.git'))) {
+ if (useGitIgnore && git.isInstalled && dirExists(path('.git'))) {
// Later versions of git do not allow a path for ls-files that appears to
// be outside of the repo, so make sure we give it a relative path.
var relativeBeneath = p.relative(beneath, from: dir);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/lish.dart ('k') | sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698