File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ usage() {
18
18
EOF
19
19
}
20
20
21
- detect_version () {
21
+ # This should always run in a subshell because it manipulates the environment
22
+ detect_version () (
23
+ # Do not allow git to walk past the ZFSBootMenu tree to find a repository
24
+ export GIT_CEILING_DIRECTORIES=" ${PWD} /.."
25
+
22
26
# If git-describe does the job, the job is done
23
27
version=" $( git describe --tags HEAD 2> /dev/null) " || version=" "
24
28
@@ -32,7 +36,7 @@ detect_version() {
32
36
fi
33
37
34
38
# Otherwise, use git-rev-parse if possible
35
- if branch=" $( git rev-parse --abbrev-rev HEAD 2> /dev/null) " ; then
39
+ if branch=" $( git rev-parse --abbrev-ref HEAD 2> /dev/null) " ; then
36
40
case " ${branch} " in
37
41
v[0-9]* ) branch=" ${branch# v} "
38
42
esac
@@ -75,7 +79,7 @@ detect_version() {
75
79
# There is apparently no version
76
80
echo " UNKNOWN"
77
81
return 1
78
- }
82
+ )
79
83
80
84
update_version () {
81
85
version=" ${1?a version is required} "
You can’t perform that action at this time.
0 commit comments