Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dc41ffa3
Commit
dc41ffa3
authored
May 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3868 from hiroponz/fix_check_git_version
Fix check git version.
parents
76842ddb
3a8ee229
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+22
-4
No files found.
lib/tasks/gitlab/check.rake
View file @
dc41ffa3
...
@@ -666,14 +666,32 @@ namespace :gitlab do
...
@@ -666,14 +666,32 @@ namespace :gitlab do
end
end
def
check_git_version
def
check_git_version
print
"Git version >= 1.7.10 ? ... "
required_version_major
=
1
required_version_minor
=
7
required_version_patch
=
10
if
run_and_match
(
"git --version"
,
/git version 1.7.10.\d/
)
required_version
=
"%d.%d.%d"
%
[
required_version_major
,
required_version_minor
,
required_version_patch
]
print
"Git version >=
#{
required_version
}
? ... "
if
m
=
run_and_match
(
"git --version"
,
/git version ((\d+)\.(\d+)\.(\d+))/
)
current_version
=
m
[
1
]
major
=
m
[
2
].
to_i
minor
=
m
[
3
].
to_i
patch
=
m
[
4
].
to_i
unless
major
<=
required_version_major
&&
minor
<=
required_version_minor
&&
patch
<
required_version_patch
satisfying_git_version
=
true
end
else
current_version
=
"Unknown"
end
if
satisfying_git_version
puts
"yes"
.
green
puts
"yes"
.
green
else
else
puts
"no"
.
red
puts
"no"
.
red
try_fixing_it
(
try_fixing_it
(
"Update your git to a version >=
1.7.10
"
"Update your git to a version >=
#{
required_version
}
from
#{
current_version
}
"
)
)
fix_and_rerun
fix_and_rerun
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment