Code

remove merge-recursive-old
[git.git] / t / t0000-basic.sh
index cf33989b5687e171bcef159f74af9a37973c1285..81f3bedc90f4ead3f12f344641d7c3bff44f6ab8 100755 (executable)
@@ -20,10 +20,10 @@ modification *should* take notice and update the test vectors here.
 
 ################################################################
 # It appears that people are getting bitten by not installing
-# 'merge' (usually part of RCS package in binary distributions)
-# or have too old python without subprocess.  Check them and error
-# out before running any tests.  Also catch the bogosity of trying
-# to run tests without building while we are at it.
+# 'merge' (usually part of RCS package in binary distributions).
+# Check this and error out before running any tests.  Also catch
+# the bogosity of trying to run tests without building while we
+# are at it.
 
 ../git >/dev/null
 if test $? != 1
@@ -42,12 +42,6 @@ fi
 
 . ./test-lib.sh
 
-test "$no_python" || "$PYTHON" -c 'import subprocess' || {
-       echo >&2 'Your python seem to lack "subprocess" module.
-Please check INSTALL document.'
-       exit 1
-}
-
 ################################################################
 # init-db has been done in an empty repository.
 # make sure it is empty.
@@ -195,6 +189,42 @@ test_expect_success \
     'git-ls-tree -r output for a known tree.' \
     'diff current expected'
 
+test_expect_success \
+    'writing partial tree out with git-write-tree --prefix.' \
+    'ptree=$(git-write-tree --prefix=path3)'
+test_expect_success \
+    'validate object ID for a known tree.' \
+    'test "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3'
+
+test_expect_success \
+    'writing partial tree out with git-write-tree --prefix.' \
+    'ptree=$(git-write-tree --prefix=path3/subp3)'
+test_expect_success \
+    'validate object ID for a known tree.' \
+    'test "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2'
+
+cat >badobjects <<EOF
+100644 blob 1000000000000000000000000000000000000000   dir/file1
+100644 blob 2000000000000000000000000000000000000000   dir/file2
+100644 blob 3000000000000000000000000000000000000000   dir/file3
+100644 blob 4000000000000000000000000000000000000000   dir/file4
+100644 blob 5000000000000000000000000000000000000000   dir/file5
+EOF
+
+rm .git/index
+test_expect_success \
+    'put invalid objects into the index.' \
+    'git-update-index --index-info < badobjects'
+
+test_expect_failure \
+    'writing this tree without --missing-ok.' \
+    'git-write-tree'
+
+test_expect_success \
+    'writing this tree with --missing-ok.' \
+    'git-write-tree --missing-ok'
+
+
 ################################################################
 rm .git/index
 test_expect_success \