Skip to content

Commit 856bea1

Browse files
committed
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.
1 parent 915b989 commit 856bea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-subtree.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ subtree_for_commit()
397397
git ls-tree "$commit" -- "$dir" |
398398
while read mode type tree name; do
399399
assert [ "$name" = "$dir" ]
400-
assert [ "$type" = "tree" ]
400+
assert [ "$type" = "tree" -o "$type" = "commit" ]
401401
echo $tree
402402
break
403403
done

0 commit comments

Comments
 (0)