@matheusbsbs / matheus-bagliano / commits / 6bd910a821
Fork 0

improved rev_is_descendant_of_branch() function

Jakub Suder committed Jan 12, 2010 at 23:34 UTC 6bd910a82155ae3def5cf38acb27d36a192c449e
1 file changed +2 -2
git-subtree.sh
+2 -2
@@ -166,9 +166,9 @@ rev_is_descendant_of_branch()
166 newrev="$1"
167 branch="$2"
168 branch_hash=$(git rev-parse $branch)
169 - match=$(git rev-list $newrev | grep $branch_hash)
169 + match=$(git rev-list -1 $branch_hash ^$newrev)
170
171 - if [ -n "$match" ]; then
171 + if [ -z "$match" ]; then
172 return 0
173 else
174 return 1