From: Avery Pennarun Date: Tue, 1 Mar 2011 00:49:42 +0000 (-0800) Subject: It's also okay if an expected tree object is actually a commit. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=856bea1f71db30339539b0c917d6d7dc32729d0f;p=git.git It's also okay if an expected tree object is actually a commit. ...that happens with submodules sometimes, so don't panic. Reported by Sum-Wai Low. --- diff --git a/git-subtree.sh b/git-subtree.sh index cf50de150..fa4e3e366 100755 --- a/git-subtree.sh +++ b/git-subtree.sh @@ -397,7 +397,7 @@ subtree_for_commit() git ls-tree "$commit" -- "$dir" | while read mode type tree name; do assert [ "$name" = "$dir" ] - assert [ "$type" = "tree" ] + assert [ "$type" = "tree" -o "$type" = "commit" ] echo $tree break done