mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
auxprogs/make_or_upd_vgversion_h : accept a git worktree as a git dir
A directory can be a git directory in 2 cases: * it is a git repository, checked with -d .git + it is a git worktree directory (see git help worktree) Modify auxprogs/make_or_upd_vgversion_h so that it detects worktree directory and produces a correct git version for --version -v
This commit is contained in:
parent
1eaff3bbd7
commit
f72dce36da
@ -2,7 +2,9 @@
|
||||
|
||||
extract_git_version()
|
||||
{
|
||||
if [ -d "$1"/.git ]
|
||||
PREVPWD="$PWD"
|
||||
cd "$1"
|
||||
if [ -d ./.git ] || git rev-parse --is-inside-work-tree > /dev/null 2> /dev/null
|
||||
then
|
||||
REV=$(git show --format=%H#%ci -s $(git rev-parse HEAD) |
|
||||
sed -e 's/ .*//' -e 's/[0-9a-f]\{30\}#/#/' -e 's/-//g' \
|
||||
@ -12,6 +14,7 @@ extract_git_version()
|
||||
else
|
||||
echo "unknown"
|
||||
fi
|
||||
cd "$PREVPWD"
|
||||
}
|
||||
|
||||
srcdir="${1:-.}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user