Showing the changes to git-refspec/src (1 of 4 files). Show all
Unified · Split
| @@ -113,7 +113,7 @@ pub(crate) mod function { · 112 unmodified lines | |||
| 113 | *spec = "HEAD".into(); | 113 | *spec = "HEAD".into(); |
| 114 | } | 114 | } |
| 115 | } | 115 | } |
| 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())?; |
| 117 | let (dst, dst_had_pattern) = validated(dst, false)?; | 117 | let (dst, dst_had_pattern) = validated(dst, false)?; |
| 118 | if !dst_had_pattern && looks_like_object_hash(dst.unwrap_or_default()) { | 118 | if !dst_had_pattern && looks_like_object_hash(dst.unwrap_or_default()) { |
| 119 | return Err(Error::InvalidFetchDestination); | 119 | return Err(Error::InvalidFetchDestination); |