From: Pelle Wessman Date: Wed, 30 Sep 2009 12:29:42 +0000 (+0200) Subject: Check that the type of the tree really is a tree and not a commit as it seems to sometimes become when eg. a submodule has existed in the same position previously. X-Git-Tag: v1.7.11-rc0~176^2~35^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8ac5eca1eaa88bd5b998e91531937404bc6425c4?hp=--cc Check that the type of the tree really is a tree and not a commit as it seems to sometimes become when eg. a submodule has existed in the same position previously. --- 8ac5eca1eaa88bd5b998e91531937404bc6425c4 diff --git a/git-subtree.sh b/git-subtree.sh index b7c741cfd4..454ce7ef22 100755 --- a/git-subtree.sh +++ b/git-subtree.sh @@ -322,6 +322,7 @@ subtree_for_commit() git ls-tree "$commit" -- "$dir" | while read mode type tree name; do assert [ "$name" = "$dir" ] + assert [ "$type" = "tree" ] echo $tree break done