Permalink
Browse files

Use only valid version tags

vim-flavor assumes that Git repositories contain "version" tags.
But the implementation assumes also that repositories do not contain
non-"version" tags.  Since repositories might contain arbitrary tags,
it is not a desirable behavior.
  • Loading branch information...
1 parent 2546eeb commit fcaf46b3eb6b96fc0476f4121f969d870a7b0f54 @Peeja Peeja committed with May 22, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/vim-flavor/flavor.rb
  2. +4 −0 spec/spec_helper.rb
View
@@ -106,7 +106,7 @@ def list_versions()
tags.
split(/[\r\n]/).
- select {|t| t != ''}.
+ select {|t| t != '' && Gem::Version.correct?(t)}.
map {|t| Gem::Version.create(t)}
end
View
@@ -20,6 +20,10 @@ def create_a_test_repo(path)
git commit -am 'Update foo'
git tag -a -m "Version $version" "$version"
done
+ for non_version in 'foo' 'bar' 'baz'
+ do
+ git tag -a -m "Non-version $non_version" "$non_version"
+ done
} >/dev/null
END
end

0 comments on commit fcaf46b

Please sign in to comment.