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

Unified Diff: lib/src/package.dart

Issue 1310253007: Make pub lish validation gitignore-aware. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: analysis hints Created 5 years, 4 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
« no previous file with comments | « no previous file | lib/src/validator.dart » ('j') | lib/src/validator/executable.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/package.dart
diff --git a/lib/src/package.dart b/lib/src/package.dart
index 28af288d66e38e29e11a25a44a410d2e59a7bcc6..90e1eaf4d48288b2c7d0849d985fb3c5e5f6be91 100644
--- a/lib/src/package.dart
+++ b/lib/src/package.dart
@@ -95,8 +95,9 @@ class Package {
/// pub.dartlang.org for choosing the primary one: the README with the fewest
/// extensions that is lexically ordered first is chosen.
String get readmePath {
- var readmes = listFiles(recursive: false).map(p.basename).
- where((entry) => entry.contains(_README_REGEXP));
+ var readmes = listFiles(recursive: false, useGitIgnore: true)
+ .map(p.basename)
+ .where((entry) => entry.contains(_README_REGEXP));
if (readmes.isEmpty) return null;
return p.join(dir, readmes.reduce((readme1, readme2) {
@@ -194,16 +195,14 @@ class Package {
/// Returns a list of files that are considered to be part of this package.
///
- /// If this is a Git repository, this will respect .gitignore; otherwise, it
- /// will return all non-hidden, non-blacklisted files.
- ///
/// If [beneath] is passed, this will only return files beneath that path,
/// which is expected to be relative to the package's root directory. If
/// [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.
+ /// account if the root directory of the package is (or is contained within) 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].
« no previous file with comments | « no previous file | lib/src/validator.dart » ('j') | lib/src/validator/executable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698