From 6bd910a82155ae3def5cf38acb27d36a192c449e Mon Sep 17 00:00:00 2001 From: Jakub Suder Date: Tue, 12 Jan 2010 23:34:52 +0100 Subject: [PATCH] improved rev_is_descendant_of_branch() function --- git-subtree.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-subtree.sh b/git-subtree.sh index 48bc57039..66ce251ea 100755 --- a/git-subtree.sh +++ b/git-subtree.sh @@ -166,9 +166,9 @@ rev_is_descendant_of_branch() newrev="$1" branch="$2" branch_hash=$(git rev-parse $branch) - match=$(git rev-list $newrev | grep $branch_hash) + match=$(git rev-list -1 $branch_hash ^$newrev) - if [ -n "$match" ]; then + if [ -z "$match" ]; then return 0 else return 1 -- 2.26.2