Skip to content

Commit

Permalink
Merge pull request #236 from lyda/git-version-bsd-fix
Browse files Browse the repository at this point in the history
Fix version processing on BSD systems.
  • Loading branch information
RichiH committed Aug 29, 2017
2 parents 978b5a8 + b469b65 commit 83ae346
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vcsh
Expand Up @@ -166,7 +166,7 @@ clone() {
You should add files to your new repository."
exit
fi
GIT_VERSION_MAJOR=$(git --version | sed -n 's/.* \([0-9]\+\)\..*/\1/p' )
GIT_VERSION_MAJOR=$(git --version | sed -E -n 's/.* ([0-9]+)\..*/\1/p' )
if [ 1 -lt "$GIT_VERSION_MAJOR" ];then
git fetch origin "$VCSH_BRANCH"
else
Expand Down Expand Up @@ -482,8 +482,8 @@ write_gitignore() {
use
cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
local GIT_VERSION="$(git --version)"
local GIT_VERSION_MAJOR=$(echo $GIT_VERSION | sed -n 's/.* \([0-9]\+\)\..*/\1/p')
local GIT_VERSION_MINOR=$(echo $GIT_VERSION | sed -n 's/.* \([0-9]\+\)\.\([0-9]\+\)\..*/\2/p')
local GIT_VERSION_MAJOR=$(echo $GIT_VERSION | sed -E -n 's/.* ([0-9]+)\..*/\1/p')
local GIT_VERSION_MINOR=$(echo $GIT_VERSION | sed -E -n 's/.* ([0-9]+)\.([0-9]+)\..*/\2/p')
OLDIFS=$IFS
IFS=$(printf '\n\t')
gitignores=$(for file in $(git ls-files); do
Expand Down

0 comments on commit 83ae346

Please sign in to comment.