History

[git-ref] clear it out and move existing functionality to git-object

This removes an uncanny dependency. Maybe now we have it the other way around. Possibly there should be a new crate to contain shared validation code? Maybe it should just be duplicated? No, that could mean code drift. It makes sense for the functionality to be included in the crate that needs it, so lets see what kind of input validation needs to happen for refs to work and if it truly is the same. As it's pretty stable there shouldn't be too much worry about somewhat similar code to exist in various crates.

Sebastian Thiel committed 5 years ago

Commit fa548ce1 parent 251e69011 files · +77 −75Browse files

Showing the changes to git-object/src/mutable (1 of 11 files). Show all

Unified · Split

git-object/src/mutable/tag.rs+2−2
@@ -10,7 +10,7 @@ quick_error! { · 9 unmodified lines
1010 StartsWithDash {
1111 display("Tags must not start with a dash: '-'")
1212 }
13− InvalidRefName(err: git_ref::validate::NameError) {
13+ InvalidRefName(err: crate::tag::validate::NameError) {
1414 display("The tag name was no valid reference name")
1515 from()
1616 source(err)
@@ -65,7 +65,7 @@ impl Tag { · 48 unmodified lines
6565 }
6666
6767 fn validated_name(name: &BStr) -> Result<&BStr, Error> {
68− git_ref::validate::name(name)?;
68+ crate::tag::validate::name(name)?;
6969 if name[0] == b'-' {
7070 return Err(Error::StartsWithDash);
7171 }