From 856bea1f71db30339539b0c917d6d7dc32729d0f Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 28 Feb 2011 16:49:42 -0800 Subject: [PATCH] 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. --- git-subtree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-subtree.sh b/git-subtree.sh index cf50de150c..fa4e3e3661 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 -- 2.11.4.GIT