1
0
mirror of synced 2026-01-12 00:42:56 +00:00

Fix Issue #2050 - loadup script failures if Medley is not a .git directory (#2052)

This commit is contained in:
Frank Halasz 2025-03-03 10:27:10 -08:00 committed by GitHub
parent 98c481ba1a
commit ebe96bc7b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,14 +50,27 @@ then
fi
fi
HAS_GIT= [ -f $(which git) ] && [ -x $(which git) ]
HAS_GIT= [ -f $(command -v git) ] && [ -x $(command -v git) ]
export HAS_GIT
git_commit_ID () {
if ${HAS_GIT};
is_git_dir () {
if ${HAS_GIT}
then
# This does NOT indicate if there are any modified files!
COMMIT_ID=$(git -C "$1" rev-parse --short HEAD)
return $(cd "$1"; git status >/dev/null 2>/dev/null; echo $?)
else
return 1
fi
}
git_commit_ID () {
if ${HAS_GIT}
then
if is_git_dir "$1"
then
# This does NOT indicate if there are any modified files!
COMMIT_ID=$(git -C "$1" rev-parse --short HEAD)
fi
fi
}