Skip to content
Snippets Groups Projects
Commit 83ae3460 authored by Richard Hartmann's avatar Richard Hartmann Committed by GitHub
Browse files

Merge pull request #236 from lyda/git-version-bsd-fix

Fix version processing on BSD systems.
parents 978b5a89 b469b65f
No related branches found
No related tags found
No related merge requests found
...@@ -166,7 +166,7 @@ clone() { ...@@ -166,7 +166,7 @@ clone() {
You should add files to your new repository." You should add files to your new repository."
exit exit
fi 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 if [ 1 -lt "$GIT_VERSION_MAJOR" ];then
git fetch origin "$VCSH_BRANCH" git fetch origin "$VCSH_BRANCH"
else else
...@@ -482,8 +482,8 @@ write_gitignore() { ...@@ -482,8 +482,8 @@ write_gitignore() {
use use
cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11 cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
local GIT_VERSION="$(git --version)" local GIT_VERSION="$(git --version)"
local GIT_VERSION_MAJOR=$(echo $GIT_VERSION | sed -n 's/.* \([0-9]\+\)\..*/\1/p') local GIT_VERSION_MAJOR=$(echo $GIT_VERSION | sed -E -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_MINOR=$(echo $GIT_VERSION | sed -E -n 's/.* ([0-9]+)\.([0-9]+)\..*/\2/p')
OLDIFS=$IFS OLDIFS=$IFS
IFS=$(printf '\n\t') IFS=$(printf '\n\t')
gitignores=$(for file in $(git ls-files); do gitignores=$(for file in $(git ls-files); do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment