Major/Minor release should reset minor/patch versions to 0

There is a bug in the current version:

```
version=1.1.3
./git-release --semver minor
version=1.2.3
```

The correct behavior should be:

```
version=1.1.3
./git-release --semver minor
version=1.2.0
```
This commit is contained in:
Tjaart van der Walt 2018-05-07 14:53:42 -07:00
parent 6f416b20c3
commit 658f133691

View file

@ -75,8 +75,8 @@ if test $# -gt 0; then
(( ++version ))
case "$semver" in
major ) version="${BASH_REMATCH[1]}$version.${BASH_REMATCH[3]}.${BASH_REMATCH[4]}${BASH_REMATCH[5]}" ;;
minor ) version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}.$version.${BASH_REMATCH[4]}${BASH_REMATCH[5]}" ;;
major ) version="${BASH_REMATCH[1]}$version.0.0${BASH_REMATCH[5]}" ;;
minor ) version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}.$version.0${BASH_REMATCH[5]}" ;;
patch ) version="${BASH_REMATCH[1]}${BASH_REMATCH[2]}.${BASH_REMATCH[3]}.$version${BASH_REMATCH[5]}" ;;
esac
fi