2011/2/5 Jonathan Nieder <jrnieder@xxxxxxxxx>: > Nguyán ThÃi Ngác Duy wrote: >> + >> +T1=f4ec99e8174c01eab488469b4c2680500bbb18da >> +T2=4b825dc642cb6eb9a060e54bf8d69288fbee4904 > > What are these trees? ÂDo they need to be hardcoded? I have uneasy feeling constructing a tree manually. Hardcoding it (or less automatic check) makes me feel better. I'm cooking a patch to make hash-object reject malformed trees/commits/tags. Then I'll remove these SHA-1. >> + >> +test_expect_success 'setup' ' >> +   printf "40000 empty\0\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04" >newtree && > > printf '\xab' is unfortunately unportable. ÂI suppose > this should rather say something like > > Âtest_unequal () { >    Âprintf '%s\n' "$1" >bad && >    Âprintf '%s\n' "$2" >actual && >    Â! test_cmp bad actual > Â} > >    Âempty_tree=$(git mktree </dev/null) && >    Âtree_with_empty_subtree=$( >        Âecho "040000 tree $empty_tree  empty" | >        Âgit mktree >    Â) && >    Âtest_unequal "$empty_tree" "$tree_with_empty_subtree" Hah! Was wondering how the heck they could create trees manually. So it's mktree. Thanks! >    Â... > > Sane? Don't know. But it's definitely saner than my version. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html