From 7d02a6a10f85061a71fb926290b8c80bbb635428 Mon Sep 17 00:00:00 2001
From: Alexander Blinne <alexander.blinne@uni-jena.de>
Date: Tue, 19 Dec 2017 15:06:19 +0100
Subject: [PATCH] Fix pre-commit hooks such that the don't mess up merges

---
 conda/pre-commit | 4 ++++
 pre-commit       | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/conda/pre-commit b/conda/pre-commit
index 3365d40..bed3c8a 100755
--- a/conda/pre-commit
+++ b/conda/pre-commit
@@ -38,6 +38,10 @@ if git diff-index --quiet HEAD --; then
     echo "No changes detected. Skipping tests..."
     sleep 1
     exitcode=0
+elif [ -e .git/MERGE_HEAD ]; then
+    echo "Merge in progress... Testing against the working directory leaving unstages changes intact!"
+    conda/run_tests.sh --fast
+    exitcode=$?
 else
     git stash -q --keep-index
     conda/run_tests.sh --fast
diff --git a/pre-commit b/pre-commit
index a200ca3..58ad1fb 100755
--- a/pre-commit
+++ b/pre-commit
@@ -37,6 +37,10 @@ if git diff-index --quiet HEAD --; then
     echo "No changes detected. Skipping tests..."
     sleep 1
     exitcode=0
+elif [ -e .git/MERGE_HEAD ]; then
+    echo "Merge in progress... Testing against the working directory leaving unstages changes intact!"
+    ./run-tests.py --fast
+    exitcode=$?
 else
     git stash -q --keep-index
     ./run-tests.py --fast
-- 
GitLab