This reverts commit
74d20040cafdced657efbf49795183d209a3a07b.
Version from Johannes to introduce GIT_TEMPLATE_DIR is simpler,
although I unconsciously stayed away from introducing yet another
environment variable.
git tar-tree initial initial | tar xf - &&
(
git tar-tree initial initial | tar xf - &&
(
- cd initial && git_init_db && git add .
+ cd initial && git init-db && git add .
) &&
git tar-tree second second | tar xf - &&
(
) &&
git tar-tree second second | tar xf - &&
(
- cd second && git_init_db && git add .
+ cd second && git init-db && git add .
'unpack without delta' \
"GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
'unpack without delta' \
"GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
git-unpack-objects -n <test-1-${packname_1}.pack &&
git-unpack-objects <test-1-${packname_1}.pack"
git-unpack-objects -n <test-1-${packname_1}.pack &&
git-unpack-objects <test-1-${packname_1}.pack"
'unpack with delta' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
'unpack with delta' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
git-unpack-objects -n <test-2-${packname_2}.pack &&
git-unpack-objects <test-2-${packname_2}.pack'
git-unpack-objects -n <test-2-${packname_2}.pack &&
git-unpack-objects <test-2-${packname_2}.pack'
'use packed objects' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
'use packed objects' \
'GIT_OBJECT_DIRECTORY=.git2/objects &&
export GIT_OBJECT_DIRECTORY &&
cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
git-diff-tree --root -p $commit &&
while read object
cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
git-diff-tree --root -p $commit &&
while read object
parent=$commit || return 1
done &&
git-update-ref HEAD "$commit" &&
parent=$commit || return 1
done &&
git-update-ref HEAD "$commit" &&
- git_clone -l ./. victim &&
+ git-clone -l ./. victim &&
cd victim &&
git-log &&
cd .. &&
cd victim &&
git-log &&
cd .. &&
(
mkdir client &&
cd client &&
(
mkdir client &&
cd client &&
- git_init_db 2>> log2.txt
+ git-init-db 2>> log2.txt
git commit -a -m original'
test_expect_success "clone and setup child repos" '
git commit -a -m original'
test_expect_success "clone and setup child repos" '
cd one &&
echo >file updated by one &&
git commit -a -m "updated by one" &&
cd .. &&
cd one &&
echo >file updated by one &&
git commit -a -m "updated by one" &&
cd .. &&
cd two &&
git repo-config branch.master.remote one &&
{
cd two &&
git repo-config branch.master.remote one &&
{
echo "Pull: refs/heads/master:refs/heads/one"
} >.git/remotes/one
cd .. &&
echo "Pull: refs/heads/master:refs/heads/one"
} >.git/remotes/one
cd .. &&
cd three &&
git repo-config branch.master.remote two &&
git repo-config branch.master.merge refs/heads/one &&
cd three &&
git repo-config branch.master.remote two &&
git repo-config branch.master.merge refs/heads/one &&
git fetch .. :track &&
git show-ref --verify refs/tags/anno &&
git fetch .. :track &&
git show-ref --verify refs/tags/anno &&
test_expect_success 'pulling into void' '
mkdir cloned &&
cd cloned &&
test_expect_success 'pulling into void' '
mkdir cloned &&
cd cloned &&
test_expect_failure \
'clone of non-existent source should fail' \
test_expect_failure \
'clone of non-existent source should fail' \
test_expect_failure \
'failed clone should not leave a directory' \
test_expect_failure \
'failed clone should not leave a directory' \
# current path not to the target dir
test_expect_failure \
'clone of non-existent (relative to $PWD) source should fail' \
# current path not to the target dir
test_expect_failure \
'clone of non-existent (relative to $PWD) source should fail' \
test_expect_success \
'clone should work now that source exists' \
test_expect_success \
'clone should work now that source exists' \
test_expect_success \
'successfull clone must leave the directory' \
test_expect_success \
'successfull clone must leave the directory' \
cd "$base_dir"
test_expect_success 'preparing second repository' \
cd "$base_dir"
test_expect_success 'preparing second repository' \
-'git_clone A B && cd B &&
+'git clone A B && cd B &&
echo second > file2 &&
git add file2 &&
git commit -m addition &&
echo second > file2 &&
git add file2 &&
git commit -m addition &&
cd "$base_dir"
test_expect_success 'cloning with reference' \
cd "$base_dir"
test_expect_success 'cloning with reference' \
-'git_clone -l -s --reference B A C'
+'git clone -l -s --reference B A C'
cd "$base_dir"
test_expect_success 'preparing second repository' \
cd "$base_dir"
test_expect_success 'preparing second repository' \
-'git_clone -l -s A B && cd B &&
+'git clone -l -s A B && cd B &&
echo "foo bar" > file2 &&
git add file2 &&
git commit -m "next commit" file2 &&
echo "foo bar" > file2 &&
git add file2 &&
git commit -m "next commit" file2 &&
cd "$base_dir"
test_expect_success 'preparing third repository' \
cd "$base_dir"
test_expect_success 'preparing third repository' \
-'git_clone -l -s B C && cd C &&
+'git clone -l -s B C && cd C &&
echo "Goodbye, cruel world" > file3 &&
git add file3 &&
git commit -m "one more" file3 &&
echo "Goodbye, cruel world" > file3 &&
git add file3 &&
git commit -m "one more" file3 &&
cd "$base_dir"
test_expect_failure 'creating too deep nesting' \
cd "$base_dir"
test_expect_failure 'creating too deep nesting' \
-'git_clone -l -s C D &&
-git_clone -l -s D E &&
-git_clone -l -s E F &&
-git_clone -l -s F G &&
-git_clone -l -s G H &&
+'git clone -l -s C D &&
+git clone -l -s D E &&
+git clone -l -s E F &&
+git clone -l -s F G &&
+git clone -l -s G H &&
test_expect_success "Michael Cassar's test case" '
rm -fr .git papers partA &&
test_expect_success "Michael Cassar's test case" '
rm -fr .git papers partA &&
mkdir -p papers/unsorted papers/all-papers partA &&
echo a > papers/unsorted/Thesis.pdf &&
echo b > partA/outline.txt &&
mkdir -p papers/unsorted papers/all-papers partA &&
echo a > papers/unsorted/Thesis.pdf &&
echo b > partA/outline.txt &&
test_expect_success "Sergey Vlasov's test case" '
rm -fr .git &&
test_expect_success "Sergey Vlasov's test case" '
rm -fr .git &&
mkdir ab &&
date >ab.c &&
date >ab/d &&
mkdir ab &&
date >ab.c &&
date >ab/d &&
-# Many tests do init-db and clone but they must be told about the freshly
-# built templates.
-git_init_db () {
- git init-db --template="$GIT_EXEC_PATH/templates/blt/" "$@"
-}
-
-git_clone () {
- git clone --template="$GIT_EXEC_PATH/templates/blt/" "$@"
-}
-
test_done () {
trap - exit
case "$test_failure" in
test_done () {
trap - exit
case "$test_failure" in