[PATCH 14/23] Introduce --tree-same.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 Documentation/git-test.txt |    2 ++
 git-conditions-lib.sh      |   12 ++++++++++++
 t/t1520-test.sh            |    9 +++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-test.txt b/Documentation/git-test.txt
index e28ed88..6709fdd 100644
--- a/Documentation/git-test.txt
+++ b/Documentation/git-test.txt
@@ -88,6 +88,8 @@ CONDITIONS
         Tests if the specified branch is (not) checked out.
 '--reachable'|'--not-reachable' first second::
 	Tests if the first commit is (not) reachable from the second.
+'--tree-same'|'--not-tree-same' first second::
+        Tests if the first commit is (not) tree-same to the second commit.
 
 EXTENDING THE CONDITION LIBRARY
 -------------------------------
diff --git a/git-conditions-lib.sh b/git-conditions-lib.sh
index 0223fcd..2b7a5d1 100644
--- a/git-conditions-lib.sh
+++ b/git-conditions-lib.sh
@@ -150,5 +150,17 @@ check_reachable_2()
 	fi     
 }
 
+check_tree_same_2()
+{
+	if git diff-tree --quiet "$1" "$2"
+	then
+		echo "'$1' has the same tree as '$2'."
+	else
+		echo "'$1' does not have the same tree as '$2'."
+		false
+	fi
+
+}
+
 
 fi
diff --git a/t/t1520-test.sh b/t/t1520-test.sh
index 3e33f8a..1fd5122 100755
--- a/t/t1520-test.sh
+++ b/t/t1520-test.sh
@@ -399,4 +399,13 @@ test_expect_success 'git test --not-reachable F C' \
        git test --not-reachable F C
 '
 
+test_expect_success 'tree-same' \
+'
+   git test \
+     --tree-same master HEAD \
+     --tree-same D D1 \
+     --not-tree-same C D
+
+'
+
 test_done
-- 
1.7.5.rc1.23.g7f622

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]