commit 18a35b702dbae8f599d1e12d09bc3116f35a41bb
Author: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
Date:   Mon Dec 12 12:08:57 2016 +0100

    git/build: do not enable git plugin by default if libgit2-glib is not installed
    
    Previously the code would always try to build the git plugin if
    "enable_git_plugin=auto" was set even when libgit2-glib was not installed at
    all.
    
    In that case the configure script exited with a somewhat confusing error message
      "please recompile a threadsafe version of libgit2 (-DTHREADSAFE:BOOL=ON)"
    when it ran a test against libgit2-glib.
    
    Now the git plugin is built by default only if autotools detects a sufficiently
    recent version of libgit2-glib.

diff --git a/plugins/git/configure.ac b/plugins/git/configure.ac
index cd4474b..46a13fb 100644
--- a/plugins/git/configure.ac
+++ b/plugins/git/configure.ac
@@ -7,16 +7,16 @@ AC_ARG_ENABLE([git-plugin],
               [enable_git_plugin=$enableval],
               [enable_git_plugin=auto])
 
-AS_IF([test "$enable_git_plugin" != no],[
-	PKG_CHECK_MODULES(GIT,
-	                  [libgit2-glib-1.0 >= ggit_required_version],
-	                  [have_git=yes],
-	                  [have_git=no])
+PKG_CHECK_MODULES(GIT,
+                  [libgit2-glib-1.0 >= ggit_required_version],
+                  [have_git=yes],
+                  [have_git=no])
 
-	AS_IF([test "$enable_git_plugin" = "yes" && test "$have_git" = "no"],[
-	       AC_MSG_ERROR([--enable-git-plugin requires libgit2-glib-1.0 >= ggit_required_version])
-	])
+AS_IF([test "$enable_git_plugin" == "yes" && test "$have_git" == "no"],[
+	AC_MSG_ERROR([--enable-git-plugin requires libgit2-glib-1.0 >= ggit_required_version])
+])
 
+AS_IF([test "$enable_git_plugin" != "no" && test "$have_git" == "yes"],[
 	enable_git_plugin=yes
 
 	dnl ***********************************************************************
@@ -50,7 +50,7 @@ AS_IF([test "$enable_git_plugin" != no],[
 	],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, please recompile a libgit2 with ssh support])])
 	CFLAGS="${cflags_save}"
 	LIBS="${libs_save}"
-])
+],[enable_git_plugin=no])
 
 AM_CONDITIONAL(ENABLE_GIT_PLUGIN, test x$enable_git_plugin = xyes)
 AC_CONFIG_FILES([plugins/git/Makefile])
