summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
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 \
"--------------------------------------------------------------------------------