[PATCH 05/23] Introduce --conflicted
---
Documentation/git-test.txt | 2 ++
git-conditions-lib.sh | 12 ++++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-test.txt b/Documentation/git-test.txt
index 9f6a4c3..4f86265 100644
--- a/Documentation/git-test.txt
+++ b/Documentation/git-test.txt
@@ -70,6 +70,8 @@ CONDITIONS
Tests if there are (not) any staged changes in the index.
'--untracked'|'--not-untracked'::
Tests if there are (not) any untracked files in the working tree.
+'--conflicted'|'--not-conflicted'::
+ Tests if there are (not) any merge conflicts in the index.
EXTENDING THE CONDITION LIBRARY
-------------------------------
diff --git a/git-conditions-lib.sh b/git-conditions-lib.sh
index 7198e6a..7f3724e 100644
--- a/git-conditions-lib.sh
+++ b/git-conditions-lib.sh
@@ -41,5 +41,17 @@ check_untracked_0()
fi
}
+check_conflicted_0()
+{
+ if test $(git ls-files --unmerged | wc -l) -ne 0
+ then
+ echo "There are unmerged files."
+ else
+ echo "There are no unmerged files."
+ false
+ fi
+
+}
+
fi
--
1.7.5.rc1.23.g7f622