Code

Sync with 1.6.3.3
[git.git] / t / t1010-mktree.sh
index 4d9b1383c67d2a736899ca3e52c99608bdb7724c..9956e3ad625eb1d70789538ecdb55e318669bdf9 100755 (executable)
@@ -10,6 +10,11 @@ test_expect_success setup '
                mkdir "$d" && echo "$d/one" >"$d/one" &&
                git add "$d"
        done &&
+       echo zero >one &&
+       git update-index --add --info-only one &&
+       git write-tree --missing-ok >tree.missing &&
+       git ls-tree $(cat tree.missing) >top.missing &&
+       git ls-tree -r $(cat tree.missing) >all.missing &&
        echo one >one &&
        git add one &&
        git write-tree >tree &&
@@ -48,6 +53,11 @@ test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
        test_cmp tree.withsub actual
 '
 
+test_expect_success 'allow missing object with --missing' '
+       git mktree --missing <top.missing >actual &&
+       test_cmp tree.missing actual
+'
+
 test_expect_failure 'mktree reads ls-tree -r output (1)' '
        git mktree <all >actual &&
        test_cmp tree actual