diff --git a/src/cmd/vendor.rs b/src/cmd/vendor.rs index b425e8a8..5a1b2737 100644 --- a/src/cmd/vendor.rs +++ b/src/cmd/vendor.rs @@ -320,7 +320,7 @@ pub fn init( // Check if includes exist for path in vendor_package.include_from_upstream.clone() { - if !PathBuf::from(extend_paths(&[path.clone()], dep_path)?[0].clone()).exists() { + if !PathBuf::from(extend_paths(&[path.clone()], dep_path, true)?[0].clone()).exists() { warnln!("{} not found in upstream, continuing.", path); } } @@ -330,7 +330,7 @@ pub fn init( true => copy_recursively( &link_from, &link_to, - &extend_paths(&vendor_package.include_from_upstream, dep_path)?, + &extend_paths(&vendor_package.include_from_upstream, dep_path, false)?, &vendor_package .exclude_from_upstream .clone() @@ -470,6 +470,7 @@ pub fn diff( &extend_paths( &vendor_package.include_from_upstream, &vendor_package.target_dir, + false, )?, &vendor_package .exclude_from_upstream @@ -788,12 +789,13 @@ pub fn copy_recursively( pub fn extend_paths( include_from_upstream: &[String], prefix: impl AsRef, + dir_only: bool, ) -> Result> { include_from_upstream .iter() .map(|pattern| { let pattern_long = PathBuf::from(pattern).prefix_paths(prefix.as_ref())?; - if pattern_long.is_dir() { + if pattern_long.is_dir() && !dir_only { Ok(String::from(pattern_long.join("**").to_str().unwrap())) } else { Ok(String::from(pattern_long.to_str().unwrap())) diff --git a/src/config.rs b/src/config.rs index a7d768ea..b2e63884 100644 --- a/src/config.rs +++ b/src/config.rs @@ -892,7 +892,7 @@ impl Validate for PartialVendorPackage { }, include_from_upstream: match self.include_from_upstream { Some(include_from_upstream) => include_from_upstream, - None => vec![String::from("**")], + None => vec![String::from("")], }, exclude_from_upstream: { let mut excl = match self.exclude_from_upstream {