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.
This commit is contained in:
Avery Pennarun 2011-02-28 16:49:42 -08:00
parent 915b9894ab
commit 856bea1f71

View File

@ -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