merged,
Maxim.

On 11/18/16 20:46, Mike Holmes wrote:
On 18 November 2016 at 05:18, Nicolas Morey-Chaisemartin
<nmo...@kalray.eu> wrote:
In git worktrees .git is a file and not a directory.
This patches replaces [ -d .git ] test by [ -e .git ]
  so it works in both cases

Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
for monarch from git becasue the tar ball is broken :(

Reviewed-by: Mike Holmes <mike.hol...@linaro.org>

---
  scripts/git_hash.sh | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh
index 336eb01..d0095d5 100755
--- a/scripts/git_hash.sh
+++ b/scripts/git_hash.sh
@@ -6,7 +6,7 @@ if [ -z ${1} ]; then
  fi
  ROOTDIR=${1}

-if [ -d ${ROOTDIR}/.git ]; then
+if [ -e ${ROOTDIR}/.git ]; then
         hash=$(git --git-dir=${ROOTDIR}/.git describe --match 
'v[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*'\
                | tr -d "\n")
         if [[ $(git --git-dir=${ROOTDIR}/.git diff --shortstat 2> /dev/null \
@@ -19,7 +19,7 @@ if [ -d ${ROOTDIR}/.git ]; then
         sed -i "s|-|.git|" ${ROOTDIR}/.scmversion
         sed -i "s|-|.|g" ${ROOTDIR}/.scmversion
         sed -i "s|^v||g" ${ROOTDIR}/.scmversion
-elif [ ! -d ${ROOTDIR}/.git -a ! -f ${ROOTDIR}/.scmversion ]; then
+elif [ ! -e ${ROOTDIR}/.git -a ! -f ${ROOTDIR}/.scmversion ]; then
         echo -n "File ROOTDIR/.scmversion not found, "
         echo "and not inside a git repository"
         echo "Bailing out! Not recoverable!"



Reply via email to