diff options
author | Valérian Rousset <tharvik@users.noreply.github.com> | 2020-12-13 22:29:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 22:29:23 +0100 |
commit | 30a32cce3a16e6c79a81aad467cfe13c12e688cb (patch) | |
tree | 0371e497218e6f3d20182757f4776bcae22eb1ec | |
parent | 3f27399d730bb9a66bebfed6aff2660828687ca5 (diff) |
-rw-r--r-- | configure.ac | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 3468cb1..aadde5b 100644 --- a/configure.ac +++ b/configure.ac @@ -152,15 +152,12 @@ AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3STATUS_ASAN_ENABLED], [], [ AC_OUTPUT -in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null` -if [ "$in_git_worktree" = "true" ]; then - git_dir=`git rev-parse --git-dir 2>/dev/null` - srcdir=`dirname "$git_dir"` - exclude_dir=`pwd | sed "s,^$srcdir,,g"` - if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then - echo "$exclude_dir" >> "$git_dir/info/exclude" - fi -fi +AS_IF([test -d ${srcdir}/.git], [ + srcdir_abs=`readlink -f "$srcdir"` + exclude_dir=`pwd | sed "s,^$srcdir_abs/*,,g"` + AS_IF([! grep -q "^$exclude_dir" "${srcdir}/.git/info/exclude"], + [echo "$exclude_dir" >> "${srcdir}/.git/info/exclude"])]) + echo \ "-------------------------------------------------------------------------------- |