aboutsummaryrefslogtreecommitdiff
path: root/tests/git.test
blob: 41d97e970d7b48c5ca58af31d27fe860cae4419f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# file      : tests/git.test
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

# Check that git version is the minimum supported one (2.12.0) or above.
#
+git --version | set git_version_out

+echo "$git_version_out" | sed -n -e 's/git version (\d+\.\d+\.\d+).*/\1/p' | \
 set git_version

+if ("$git_version" == "")
  exit "unable to obtain git version from '$git_version_out'"
end

+echo "$git_version" | sed -e 's/(\d+).*/\1/'      | set git_version_major
+echo "$git_version" | sed -e 's/\d+\.(\d+).*/\1/' | set git_version_minor

# This flag must be used by testscripts to decide if they should skip git
# repository-related tests.
#
git_supported = ($git_version_major >  2 || \
		 $git_version_major == 2 && $git_version_minor >= 12)