History

more push-spec restrictions (#450)

Sebastian Thiel committed 4 years ago

Commit bb992ac1 parent 57a6e694 files · +43 −3Browse files

Showing the changes to git-refspec/src (1 of 4 files). Show all

Unified · Split

git-refspec/src/parse.rs+1−1
@@ -113,7 +113,7 @@ pub(crate) mod function { · 112 unmodified lines
113113 *spec = "HEAD".into();
114114 }
115115 }
116− let (src, src_had_pattern) = validated(src, operation == Operation::Push)?;
116+ let (src, src_had_pattern) = validated(src, operation == Operation::Push && dst.is_some())?;
117117 let (dst, dst_had_pattern) = validated(dst, false)?;
118118 if !dst_had_pattern && looks_like_object_hash(dst.unwrap_or_default()) {
119119 return Err(Error::InvalidFetchDestination);