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.
Avery Pennarun committed
Feb 28, 2011 at 16:49 UTC
856bea1f71db30339539b0c917d6d7dc32729d0f
1 file changed
+1
-1
git-subtree.sh
+1
-1
@@ -397,7 +397,7 @@ subtree_for_commit()
397
git ls-tree "$commit" -- "$dir" |
398
while read mode type tree name; do
399
assert [ "$name" = "$dir" ]
400
- assert [ "$type" = "tree" ]
400
+ assert [ "$type" = "tree" -o "$type" = "commit" ]
401
echo $tree
402
break
403
done