commit - d7a689ea907503c998ff3b75af65066ce8ec680d
commit + d1e03b8cc3ffd9122ab07adab47d84534f70bd67
blob - 31567d2fc90dcccd8d23c81bc042414e05d514b1
blob + 55a49c904e9d8a41678453f55fcedc15a081516f
--- regress/cmdline/add.sh
+++ regress/cmdline/add.sh
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
got checkout $testroot/repo $testroot/wt > /dev/null
blob - 76bc77fd0afea94f3494da3f05e3f617d0019853
blob + 1da1bae6d4b501b17d00e4ab519191174f617fcf
--- regress/cmdline/backout.sh
+++ regress/cmdline/backout.sh
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "commit changes on newbranch"
local commit_time=`git_show_author_time $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch2)
+ git -C $testroot/repo checkout -q -b newbranch2
echo "modified delta on branch2" > $testroot/repo/gamma/delta
echo "modified alpha on branch2" > $testroot/repo/alpha
echo "new file on branch2" > $testroot/repo/epsilon/new2
- (cd $testroot/repo && git add epsilon/new2)
+ git -C $testroot/repo add epsilon/new2
git_commit $testroot/repo -m "commit changes on newbranch2"
local b2_commit_time=`git_show_author_time $testroot/repo`
blob - 709d4ccef8fe3657aabd7178ce86cd34b6abd820
blob + 58bd8cfd19c7fe4497faed3ae1bc31b8c288fc98
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
(cd $testroot/wt && got blame "$file" | cut -d ' ' -f 2 \
> $testroot/${file}.blame.got)
- (cd $testroot/repo && git reset --hard master > /dev/null)
- (cd $testroot/repo && git blame "$file" | cut -d ' ' -f 1 \
- > $testroot/${file}.blame.git)
+ git -C $testroot/repo reset --hard master > /dev/null
+ git -C $testroot/repo blame "$file" | cut -d ' ' -f 1 \
+ > $testroot/${file}.blame.git
cmp -s $testroot/${file}.blame.git $testroot/${file}.blame.got
ret=$?
(cd $testroot/wt && got commit -m "change 2" > /dev/null)
local commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git tag -a -m "test" $tag)
+ git -C $testroot/repo tag -a -m "test" $tag
echo 3 >> $testroot/wt/alpha
(cd $testroot/wt && got commit -m "change 3" > /dev/null)
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
# Attempt a (nonsensical) blame of a submodule.
got blame -r $testroot/repo repo2 \
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
blob - 32ca2931e3071c10d03c698a6c1fbac3f2513eeb
blob + 6b14508b86ae76b06c4b422f9dddcb726e665798
--- regress/cmdline/branch.sh
+++ regress/cmdline/branch.sh
fi
# Ensure that Git recognizes the branch Got has created
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q anotherbranch)
+ git -C $testroot/repo checkout -q anotherbranch
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q yetanotherbranch)
+ git -C $testroot/repo checkout -q yetanotherbranch
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q commitbranch)
+ git -C $testroot/repo checkout -q commitbranch
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
fi
done
- (cd $testroot/repo && git pack-refs --all)
+ git -C $testroot/repo pack-refs --all
got branch -d refs/heads/branch2 -r $testroot/repo > $testroot/stdout
ret=$?
blob - 5a8e3fca28fe70ffe66034d95186576fce8f8100
blob + 9d71d8d52004f89383a535be68110b0dbb61be97
--- regress/cmdline/cat.sh
+++ regress/cmdline/cat.sh
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
got cat -r $testroot/repo repo2 > $testroot/stdout \
> $testroot/stdout 2> $testroot/stderr
local author_time=`git_show_author_time $testroot/repo`
local gmtoff=`date +%z`
- (cd $testroot && git clone -q repo repo2 >/dev/null)
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot clone -q repo repo2 >/dev/null
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
# 'got cat' shows the commit object which the submodule points to
# because a commit with the same ID exists in the outer repository
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local alpha_link_id=`got tree -r $testroot/repo -i | grep 'alpha.link@ -> alpha$' | cut -d' ' -f 1`
blob - 95f34afe31e5991bc2dfc22ad99e44cdd23832cc
blob + f5b8de097637f7d3a470a2430dce513a1cc859f8
--- regress/cmdline/checkout.sh
+++ regress/cmdline/checkout.sh
touch $testroot/repo/xfile
chmod +x $testroot/repo/xfile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding executable file"
local commit_id=`git_show_head $testroot/repo`
test_checkout_commit_from_wrong_branch() {
local testroot=`test_init checkout_commit_from_wrong_branch`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on new branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha on new branch"
local commit_id=`git_show_head $testroot/repo`
local tag="1.0.0"
- (cd $testroot/repo && git tag -a -m "test" $tag)
+ git -C $testroot/repo tag -a -m "test" $tag
echo "A $testroot/wt/alpha" > $testroot/stdout.expected
echo "A $testroot/wt/beta" >> $testroot/stdout.expected
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
local commit_id=`git_show_head $testroot/repo`
echo "A $testroot/wt/.gitmodules" > $testroot/stdout.expected
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
(cd $testroot && got checkout $testroot/repo wt > /dev/null)
test_checkout_repo_with_unknown_extension() {
local testroot=`test_init checkout_repo_with_unknown_extension`
- (cd $testroot/repo &&
- git config --add extensions.badExtension foobar)
- (cd $testroot/repo &&
- git config --add extensions.otherBadExtension 0)
+ git -C $testroot/repo config --add extensions.badExtension foobar
+ git -C $testroot/repo config --add extensions.otherBadExtension 0
echo "got: badExtension: unsupported repository format extension" \
> $testroot/stderr.expected
blob - 01c492937e9b0b533e2d98b5ab40a43cf5e03129
blob + 009d3307e4bb52ea5a0921669a3507a59bc86a19
--- regress/cmdline/cherrypick.sh
+++ regress/cmdline/cherrypick.sh
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local branch_rev=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
- (cd $testroot/repo && git rm -q alpha)
- (cd $testroot/repo && git rm -q beta)
- (cd $testroot/repo && git rm -q epsilon/zeta)
- (cd $testroot/repo && git rm -q gamma/delta)
+ git -C $testroot/repo checkout -q -b newbranch
+ git -C $testroot/repo rm -q alpha
+ git -C $testroot/repo rm -q beta
+ git -C $testroot/repo rm -q epsilon/zeta
+ git -C $testroot/repo rm -q gamma/delta
mkdir -p $testroot/repo/epsilon
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing on newbranch"
echo "modified new file on branch" >> $testroot/repo/epsilon/new
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local branch_rev=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local branch_rev=`git_show_head $testroot/repo`
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
got checkout $testroot/repo $testroot/wt > /dev/null
echo "modified foo" > $testroot/repo2/foo
- (cd $testroot/repo2 && git commit -q -a -m 'modified a submodule')
+ git -C $testroot/repo2 commit -q -a -m 'modified a submodule'
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
# Update the repo/repo2 submodule link on newbranch
- (cd $testroot/repo && git -C repo2 pull -q)
- (cd $testroot/repo && git add repo2)
+ git -C $testroot/repo/repo2 pull -q
+ git -C $testroot/repo add repo2
git_commit $testroot/repo -m "modified submodule link"
local commit_id=`git_show_head $testroot/repo`
make_single_file_repo $testroot/repo2 foo
# Add the repo/repo2 submodule on newbranch
- (cd $testroot/repo && git checkout -q -b newbranch)
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo checkout -q -b newbranch
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
local commit_id=`git_show_head $testroot/repo`
(cd $testroot/wt && got cherrypick $commit_id > $testroot/stdout)
make_single_file_repo $testroot/repo2 foo
# Add the repo/repo2 submodule on newbranch
- (cd $testroot/repo && git checkout -q -b newbranch)
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo checkout -q -b newbranch
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
local commit_id=`git_show_head $testroot/repo`
# Modify the clashing file such that any modifications brought
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && rm epsilon.link && ln -s gamma epsilon.link)
(cd $testroot/repo && ln -sf ../gamma/delta epsilon/beta.link)
(cd $testroot/repo && ln -sf .got/foo $testroot/repo/dotgotfoo.link)
- (cd $testroot/repo && git rm -q nonexistent.link)
+ git -C $testroot/repo rm -q nonexistent.link
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "change symlinks"
local commit_id2=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -sf ../gamma/delta epsilon/beta.link)
echo 'this is regular file foo' > $testroot/repo/dotgotfoo.link
(cd $testroot/repo && ln -sf .got/bar dotgotbar.link)
- (cd $testroot/repo && git rm -q nonexistent.link)
+ git -C $testroot/repo rm -q nonexistent.link
(cd $testroot/repo && ln -sf gamma/delta zeta.link)
(cd $testroot/repo && ln -sf alpha new.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "change symlinks"
local commit_id2=`git_show_head $testroot/repo`
test_cherrypick_with_path_prefix_and_empty_tree() {
local testroot=`test_init cherrypick_with_path_prefix_and_empty_tree 1`
- (cd $testroot/repo && git commit --allow-empty \
- -m "initial empty commit" >/dev/null)
+ git -C $testroot/repo commit --allow-empty \
+ -m "initial empty commit" >/dev/null
(cd $testroot/repo && got br bar >/dev/null)
mkdir -p $testroot/repo/epsilon
echo "file foo" > $testroot/repo/epsilon/foo
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add file foo"
local commit_id=`git_show_head $testroot/repo`
local content_c="aaa\naaa\nccc\naaa\naaa\naaa\naaa"
printf "$content_a" > $testroot/repo/a
- (cd $testroot/repo && git add a)
+ git -C $testroot/repo add a
git_commit $testroot/repo -m "initial commit"
(cd $testroot/repo && got branch newbranch)
local content_c="aaa\naaa\nbbb\naaa\naaa\naaa\n"
printf "$content_a" > $testroot/repo/a
- (cd $testroot/repo && git add a)
+ git -C $testroot/repo add a
git_commit $testroot/repo -m "initial commit"
(cd $testroot/repo && got branch newbranch)
}
}
EOF
- (cd $testroot/repo && git add reference.c)
+ git -C $testroot/repo add reference.c
git_commit $testroot/repo -m "added reference.c file"
local base_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
ed -s $testroot/repo/reference.c <<EOF
91a
if (!is_valid_ref_name(name))
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local branch_rev=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
printf "modified\n:delta\n.\non\n:branch\n" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local branch_rev=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "commit changes on newbranch"
local commit_time=`git_show_author_time $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch2)
+ git -C $testroot/repo checkout -q -b newbranch2
echo "modified delta on branch2" > $testroot/repo/gamma/delta
echo "modified alpha on branch2" > $testroot/repo/alpha
echo "new file on branch2" > $testroot/repo/epsilon/new2
- (cd $testroot/repo && git add epsilon/new2)
+ git -C $testroot/repo add epsilon/new2
git_commit $testroot/repo -m "commit changes on newbranch2"
local b2_commit_time=`git_show_author_time $testroot/repo`
set -- "$(git_show_head $testroot/repo)"
- (cd $testroot/repo && git checkout -q -b branch-1)
+ git -C $testroot/repo checkout -q -b branch-1
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
blob - f4a50c06198ba6fd2e8397c44a51a8aaa92817d3
blob + 0e7cf31f819a9e93d3c0add3720b63ae6d10314b
--- regress/cmdline/cleanup.sh
+++ regress/cmdline/cleanup.sh
gotadmin pack -a -r "$testroot/repo" >/dev/null
# create another one with unreachable objects
- (cd "$testroot/repo" && git checkout -q -b tempbranch)
+ git -C "$testroot/repo" checkout -q -b tempbranch
echo "modified alpha on tempbranch" >$testroot/repo/alpha
git_commit "$testroot/repo" -m "edit alpha on tempbranch"
gotadmin pack -a -r "$testroot/repo" >/dev/null
- (cd "$testroot/repo" && git checkout -q master)
+ git -C "$testroot/repo" checkout -q master
(cd "$testroot/repo" && got branch -d tempbranch) >/dev/null
gotadmin cleanup -a -q -r "$testroot/repo"
rm "${kpack%.pack}.keep"
# create some commits on a separate branch
- (cd "$testroot/repo" && git checkout -q -b newbranch)
+ git -C "$testroot/repo" checkout -q -b newbranch
for i in `jot 5`; do
echo "alpha $i" > $testroot/repo/alpha
local testroot=`test_init cleanup_precious_objects`
# enable Git's preciousObjects extension
- (cd $testroot/repo && git config extensions.preciousObjects true)
+ git -C $testroot/repo config extensions.preciousObjects true
# cleanup should now refuse to purge objects
gotadmin cleanup -a -q -r $testroot/repo > $testroot/stdout \
blob - 69a9a2773510acc956e60ec5b87ae8aad43b8d8c
blob + 5f92bc4c5f41eaab6b2619e4a75bc863402edc0c
--- regress/cmdline/commit.sh
+++ regress/cmdline/commit.sh
(cd $testroot/wt && got commit -m 'test' > /dev/null)
# Let git-fsck verify the newly written tree to make sure Git is happy
- (cd $testroot/repo && git fsck --strict \
- > $testroot/fsck.stdout 2> $testroot/fsck.stderr)
+ git -C $testroot/repo fsck --strict \
+ > $testroot/fsck.stdout 2> $testroot/fsck.stderr
ret=$?
test_done "$testroot" "$ret"
}
return 1
fi
- (cd $testroot/repo && git config user.name 'Flan Luck')
- (cd $testroot/repo && git config user.email 'flan_luck@openbsd.org')
+ git -C $testroot/repo config user.name 'Flan Luck'
+ git -C $testroot/repo config user.email 'flan_luck@openbsd.org'
echo "modified alpha" > $testroot/wt/alpha
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
got checkout $testroot/repo $testroot/wt > /dev/null
ret=$?
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
local bo_logmsg_prefix="log message of backed-out commit"
local cy_logmsg_prefix="log message of cherrypicked commit"
echo "modified delta on branch" > $testroot/repo/gamma/delta
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "$branch_rev_logmsg"
local branch_rev=`git_show_head $testroot/repo`
blob - 1953bc200e17164aa10a916bace8f33f989e2f20
blob + 81b9822d1f9eedf1c0a8fa1df858c1632f897edb
--- regress/cmdline/common.sh
+++ regress/cmdline/common.sh
{
local repo="$1"
shift
- (cd $repo && git commit --author="$GOT_AUTHOR" -q -a "$@")
+ git -C $repo commit --author="$GOT_AUTHOR" -q -a "$@"
maybe_pack_repo $repo
}
{
local repo="$1"
shift
- (cd $repo && git rm -q "$@")
+ git -C $repo rm -q "$@"
}
git_rmdir()
{
local repo="$1"
shift
- (cd $repo && git rm -q -r "$@")
+ git -C $repo rm -q -r "$@"
}
git_show_head()
{
local repo="$1"
- (cd $repo && git show --no-patch --pretty='format:%H')
+ git -C $repo show --no-patch --pretty='format:%H'
}
git_show_branch_head()
{
local repo="$1"
local branch="$2"
- (cd $repo && git show --no-patch --pretty='format:%H' $branch)
+ git -C $repo show --no-patch --pretty='format:%H' $branch
}
{
local repo="$1"
local object="$2"
- (cd $repo && git show --no-patch --pretty='format:%at' $object)
+ git -C $repo show --no-patch --pretty='format:%at' $object
}
git_show_tagger_time()
{
local repo="$1"
local tag="$2"
- (cd $repo && git cat-file tag $tag | grep ^tagger | \
- sed -e "s/^tagger $GOT_AUTHOR//" | cut -d' ' -f2)
+ git -C $repo cat-file tag $tag | grep ^tagger | \
+ sed -e "s/^tagger $GOT_AUTHOR//" | cut -d' ' -f2
}
git_show_parent_commit()
{
local repo="$1"
local commit="$2"
- (cd $repo && git show --no-patch --pretty='format:%P' $commit)
+ git -C $repo show --no-patch --pretty='format:%P' $commit
}
git_show_tree()
{
local repo="$1"
- (cd $repo && git show --no-patch --pretty='format:%T')
+ git -C $repo show --no-patch --pretty='format:%T'
}
trim_obj_id()
local repo="$1"
local msg="$2"
local tree="$3"
- (cd $repo && git commit-tree -m "$msg" "$tree")
+ git -C $repo commit-tree -m "$msg" "$tree"
}
git_fsck()
local testroot="$1"
local repo="$2"
- (cd $repo && git fsck --strict \
- > $testroot/fsck.stdout 2> $testroot/fsck.stderr)
+ git -C $repo fsck --strict \
+ > $testroot/fsck.stdout 2> $testroot/fsck.stderr
ret=$?
if [ $ret -ne 0 ]; then
echo -n "git fsck: "
mkdir $repo
git_init $repo
echo "this is file $file" > $repo/$file
- (cd $repo && git add .)
+ git -C $repo add .
git_commit $repo -m "intialize $repo with file $file"
}
git_init $testroot/repo
if [ -z "$no_tree" ]; then
make_test_tree $testroot/repo
- (cd $repo && git add .)
+ git -C $repo add .
git_commit $testroot/repo -m "adding the test tree"
fi
touch $testroot/repo/.git/git-daemon-export-ok
blob - f24be2ec6def2b1c4206a2f88553c21f47ae2eb9
blob + 59243b5c07792da8486b3128282d07cd79ae5bbe
--- regress/cmdline/diff.sh
+++ regress/cmdline/diff.sh
echo "6" >> $testroot/repo/numbers
echo "7" >> $testroot/repo/numbers
echo "8" >> $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local base_commit=`git_show_head $testroot/repo`
git_commit $testroot/repo -m "changed alpha"
local commit_id1=`git_show_head $testroot/repo`
- (cd $testroot/repo && git tag -m "test" $tag1)
+ git -C $testroot/repo tag -m "test" $tag1
echo "new file" > $testroot/repo/new
- (cd $testroot/repo && git add new)
+ git -C $testroot/repo add new
git_commit $testroot/repo -m "new file"
local commit_id2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git tag -m "test" $tag2)
+ git -C $testroot/repo tag -m "test" $tag2
echo "diff $commit_id0 refs/tags/$tag1" > $testroot/stdout.expected
echo "commit - $commit_id0" >> $testroot/stdout.expected
git_commit $testroot/repo -m "changed alpha"
local commit_id1=`git_show_head $testroot/repo`
- (cd $testroot/repo && git tag $tag1)
+ git -C $testroot/repo tag $tag1
echo "new file" > $testroot/repo/new
- (cd $testroot/repo && git add new)
+ git -C $testroot/repo add new
git_commit $testroot/repo -m "new file"
local commit_id2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git tag $tag2)
+ git -C $testroot/repo tag $tag2
echo "diff $commit_id0 refs/tags/$tag1" > $testroot/stdout.expected
echo "commit - $commit_id0" >> $testroot/stdout.expected
test_diff_submodule_of_same_repo() {
local testroot=`test_init diff_submodule_of_same_repo`
- (cd $testroot && git clone -q repo repo2 >/dev/null)
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot clone -q repo repo2 >/dev/null
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
epsilon_id=$(got tree -r $testroot/repo -i | grep 'epsilon/$' | \
cut -d ' ' -f 1)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -s .got/foo dotgotfoo.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && rm epsilon.link && ln -s gamma epsilon.link)
(cd $testroot/repo && ln -sf ../gamma/delta epsilon/beta.link)
(cd $testroot/repo && ln -sf .got/bar $testroot/repo/dotgotfoo.link)
- (cd $testroot/repo && git rm -q nonexistent.link)
+ git -C $testroot/repo rm -q nonexistent.link
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "change symlinks"
local commit_id2=`git_show_head $testroot/repo`
git_rm $testroot/repo alpha
mkdir $testroot/repo/alpha
echo eta > $testroot/repo/alpha/eta
- (cd $testroot/repo && git add alpha/eta)
+ git -C $testroot/repo add alpha/eta
git_commit $testroot/repo -m "changed alpha into directory"
local commit_id1=`git_show_head $testroot/repo`
local alpha_eta_blobid=`get_blob_id $testroot/repo alpha eta`
git_rmdir $testroot/repo epsilon
echo epsilon > $testroot/repo/epsilon
- (cd $testroot/repo && git add epsilon)
+ git -C $testroot/repo add epsilon
git_commit $testroot/repo -m "changed epsilon into file"
local commit_id1=`git_show_head $testroot/repo`
local epsilon_blobid=`get_blob_id $testroot/repo "" epsilon`
blob - f7c13d273418faebbf6a5954344c0c7ced9da08c
blob + 4f75fc02d6a40ac31f5851218e869d2b5526e031
--- regress/cmdline/dump.sh
+++ regress/cmdline/dump.sh
return 1
fi
- if ! (cd "$testroot" && git clone -b master -q r.bundle); then
+ if ! git -C "$testroot" clone -b master -q r.bundle; then
echo "failed to git clone from the generated bundle" >&2
test_done "$testroot" 1
return 1
return 1
fi
- (cd "$testroot/repo" && git checkout -q -b newbranch)
+ git -C "$testroot/repo" checkout -q -b newbranch
# commit some changes in the repo
for i in `seq 5`; do
return 1
fi
- (cd "$testroot/r" && git checkout -q -b newbranch && \
- git pull -q "$testroot/r.bundle" newbranch)
+ git -C "$testroot/r" checkout -q -b newbranch && \
+ git -C "$testroot/r" pull -q "$testroot/r.bundle" newbranch
if [ $? -ne 0 ]; then
echo "git pull failed unexpectedly" >&2
test_done "$testroot" 1
blob - 43b93382975fd45e5fa0e500f6a776d9343347c1
blob + bc9c071363d678f9caf6ad6317ddab429ffee389
--- regress/cmdline/fetch.sh
+++ regress/cmdline/fetch.sh
git_commit $testroot/repo -m "modified alpha"
local commit_id2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q foo)
+ git -C $testroot/repo checkout -q foo
echo "modified alpha on foo" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha"
local commit_id3=`git_show_head $testroot/repo`
local commit_id4=`git_show_head $testroot/repo`
# set the default HEAD branch back to master
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
got checkout -b foo $testroot/repo-clone $testroot/wt > /dev/null
EOF
# make another change on 'foo' and fetch it without got.conf
- (cd $testroot/repo && git checkout -q foo)
+ git -C $testroot/repo checkout -q foo
echo "modified beta on foo agan" > $testroot/repo/beta
git_commit $testroot/repo -m "modified beta"
local commit_id5=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
# fetch new commits on branch 'foo', implicitly obtaining the
# branch name from a work tree
diff -u $testroot/stdout.expected $testroot/stdout
fi
- (cd $testroot/repo && git checkout -q foo)
+ git -C $testroot/repo checkout -q foo
echo "modified beta on foo" > $testroot/repo/beta
git_commit $testroot/repo -m "modified beta"
local commit_id2=`git_show_head $testroot/repo`
# set the default HEAD branch back to master
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
# remove default branch from got.conf, fetch all branches
ed -s $testroot/repo-clone/got.conf <<-EOF
git_commit $testroot/repo -m "modified alpha"
local commit_id2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q foo)
+ git -C $testroot/repo checkout -q foo
echo "modified alpha on foo" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha"
local commit_id3=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
got fetch -q -r $testroot/repo-clone -R refs/remotes/origin/main \
> $testroot/stdout 2> $testroot/stderr
local commit_id=`git_show_head $testroot/repo`
got branch -r $testroot/repo -c $commit_id boo
- (cd $testroot/repo && git checkout -q boo)
+ git -C $testroot/repo checkout -q boo
echo "modified beta on boo" > $testroot/repo/beta
git_commit $testroot/repo -m "modified beta"
local commit_id2=`git_show_head $testroot/repo`
got branch -r $testroot/repo -c $commit_id2 hoo
- (cd $testroot/repo && git checkout -q hoo)
+ git -C $testroot/repo checkout -q hoo
echo "modified delta on hoo" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "modified delta"
local commit_id3=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
got clone -q $testurl/repo $testroot/repo-clone
ret=$?
if [ $ret -ne 0 ]; then
return 1
fi
- (cd $testroot/repo && git checkout -q boo)
+ git -C $testroot/repo checkout -q boo
# clone has remote/origin/HEAD symref with "master" as its target
# but the repo has changed HEAD to "boo", so we should fetch "boo"
echo "HEAD: refs/heads/master" > $testroot/stdout.expected
git_commit $testroot/repo -m "modified delta"
local commit_id4=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
got checkout -b boo $testroot/repo-clone $testroot/wt > /dev/null
(cd $testroot/wt && got fetch -q > $testroot/stdout)
git_commit $testroot/repo -m "modified delta on master"
local commit_id5=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q boo)
+ git -C $testroot/repo checkout -q boo
echo "modified alpha on boo" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha on boo"
local commit_id6=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q hoo)
+ git -C $testroot/repo checkout -q hoo
echo "modified beta on hoo" > $testroot/repo/beta
git_commit $testroot/repo -m "modified beta on hoo"
local commit_id7=`git_show_head $testroot/repo`
# from wt: fetch -b hoo not got.conf "master" or wt "boo" or
# repo HEAD "boo"
- (cd $testroot/repo && git checkout -q boo)
+ git -C $testroot/repo checkout -q boo
echo "modified alpha again on boo" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha again on boo"
local commit_id8=`git_show_head $testroot/repo`
blob - 5ef42917a9efb422c5a96479122b03533f9019bc
blob + a8c20c791a546fc257c69e471cb4ff9e59cd4d66
--- regress/cmdline/histedit.sh
+++ regress/cmdline/histedit.sh
local orig_author_time=`git_show_author_time $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local old_author_time1=`git_show_author_time $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes 1"
local old_commit1=`git_show_head $testroot/repo`
local short_old_commit1=`trim_obj_id 28 $old_commit1`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes 1"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "added new file epsilon/psi" > $testroot/repo/epsilon/psi
- (cd $testroot/repo && git add epsilon/psi)
+ git -C $testroot/repo add epsilon/psi
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
git_commit $testroot/repo -m "editing psi"
local old_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git rm -q epsilon/psi)
+ git -C $testroot/repo rm -q epsilon/psi
git_commit $testroot/repo -m "removing psi"
local old_commit3=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modify alpha" > $testroot/repo/alpha
- (cd $testroot/repo && git add alpha)
+ git -C $testroot/repo add alpha
git_commit $testroot/repo -m "modified alpha"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git rm -q alpha)
+ git -C $testroot/repo rm -q alpha
git_commit $testroot/repo -m "removing alpha"
local old_commit1=`git_show_head $testroot/repo`
echo "modified alpha" >$testroot/repo/alpha
- (cd $testroot/repo && git add alpha)
+ git -C $testroot/repo add alpha
git_commit $testroot/repo -m "add back modified alpha"
local old_commit2=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
local orig_commit=`git_show_head $testroot/repo`
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m 'committing changes'
local old_commit1=`git_show_head $testroot/repo`
local dropmsg="commit changes to drop"
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "$dropmsg 1"
local drop_commit1=`git_show_head $testroot/repo`
blob - 614c0254175714f853d026e00d9c0330ef34b33a
blob + 3deea57b8d4424f745a81ebe3900dbf4632bd8d7
--- regress/cmdline/import.sh
+++ regress/cmdline/import.sh
local testroot=`test_init import_detached_head`
# mute verbose 'detached HEAD' warning
- (cd $testroot/repo && git config --local advice.detachedHead false)
+ git -C $testroot/repo config --local advice.detachedHead false
ret=$?
if [ $ret -ne 0 ]; then
test_done "$testroot" "$ret"
# enter detached HEAD state
local head_commit=`git_show_head $testroot/repo | cut -c1-7`
- (cd $testroot/repo && \
- git checkout $head_commit > $testroot/stdout 2> $testroot/stderr)
+ git -C $testroot/repo checkout $head_commit \
+ > $testroot/stdout 2> $testroot/stderr
ret=$?
if [ $ret -ne 0 ]; then
test_done "$testroot" "$ret"
return 1
fi
- local main_commit=`(cd $testroot/repo && \
- git show-ref main | cut -d ' ' -f 1)`
+ local main_commit=`git -C $testroot/repo show-ref main | \
+ cut -d ' ' -f 1`
echo "A $testroot/import/gamma/delta" > $testroot/stdout.expected
echo "A $testroot/import/epsilon/zeta" >> $testroot/stdout.expected
echo "A $testroot/import/alpha" >> $testroot/stdout.expected
blob - 22184fffc887851e4b8c369a306088ffc4bf4686
blob + ccba2603a3aa69bd7de8eff0d30822576810bc01
--- regress/cmdline/init.sh
+++ regress/cmdline/init.sh
gotadmin init $testroot/repo
- local git_head=`(cd $testroot/repo && git symbolic-ref HEAD)`
+ local git_head=`git -C $testroot/repo symbolic-ref HEAD`
echo $git_head > $testroot/content
echo refs/heads/$headref > $testroot/content.expected
cmp -s $testroot/content.expected $testroot/content
gotadmin init -b $headref $testroot/repo
- local git_head=`(cd $testroot/repo && git symbolic-ref HEAD)`
+ local git_head=`git -C $testroot/repo symbolic-ref HEAD`
echo refs/heads/$headref > $testroot/content.expected
echo $git_head > $testroot/content
cmp -s $testroot/content.expected $testroot/content
blob - fea0fbd0c0b880d3f283fc17453e349290b0a480
blob + c57691ca2631de000f749d2c7fcb80c7ba746eec
--- regress/cmdline/integrate.sh
+++ regress/cmdline/integrate.sh
test_integrate_basic() {
local testroot=`test_init integrate_basic`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
local testroot=`test_init integrate_requires_rebase_first`
local init_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
test_integrate_path_prefix() {
local testroot=`test_init integrate_path_prefix`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
test_integrate_backwards_in_time() {
local testroot=`test_init integrate_backwards_in_time`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
blob - 70bf269325f1dc66d6be29ef5f6b010108cfb01a
blob + 50222a69eaa0c608bf4501525a4ccd51cfe0aa70
--- regress/cmdline/load.sh
+++ regress/cmdline/load.sh
local testroot=`test_init test_load_bundle`
# generate a bundle with all the history of the repository
- (cd "$testroot/repo" && git bundle create -q "$testroot/bundle" master)
+ git -C "$testroot/repo" bundle create -q "$testroot/bundle" master
# then load it in an empty repository
(cd "$testroot/" && gotadmin init -b master repo2) >/dev/null
echo "modified alpha in master" >$testroot/repo/alpha
git_commit "$testroot/repo" -m "edit alpha in master"
- (cd "$testroot/repo" && git bundle create -q \
- "$testroot/bundle" "$base..master")
+ git -C "$testroot/repo" bundle create -q \
+ "$testroot/bundle" "$base..master"
(cd "$testroot/repo2" && gotadmin load < "$testroot/bundle") >/dev/null
if [ $? -ne 0 ]; then
master_commit="$(git_show_head "$testroot/repo")"
- (cd "$testroot/repo" && git checkout -q -b newbranch)
+ git -C "$testroot/repo" checkout -q -b newbranch
for i in `seq 1`; do
echo "alpha edit #$i" > $testroot/repo/alpha
blob - 853ae57628cf6cdee057c1be172a74f5600d337e
blob + 4721d314c761fef6ff7f1dfe3ff55d52e6d39216
--- regress/cmdline/log.sh
+++ regress/cmdline/log.sh
make_test_tree $testroot/repo
mkdir -p $testroot/repo/epsilon/d
echo foo > $testroot/repo/epsilon/d/foo
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding the test tree"
local head_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git tag -a -m "test" $tag)
+ git -C $testroot/repo tag -a -m "test" $tag
echo "commit $commit_id (master, tags/$tag)" > $testroot/stdout.expected
(cd $testroot/wt && got log -l1 -c $tag | grep ^commit \
fi
# test a "lightweight" tag
- (cd $testroot/repo && git tag $tag2)
+ git -C $testroot/repo tag $tag2
echo "commit $commit_id (master, tags/$tag, tags/$tag2)" \
> $testroot/stdout.expected
make_test_tree $testroot/repo
mkdir -p $testroot/repo/epsilon/d
echo foo > $testroot/repo/epsilon/d/foo
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding the test tree"
local head_commit=`git_show_head $testroot/repo`
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
local head_commit=`git_show_head $testroot/repo`
echo "commit $head_commit (master)" > $testroot/stdout.expected
fi
echo "modified foo" > $testroot/repo2/foo
- (cd $testroot/repo2 && git commit -q -a -m 'modified a submodule')
+ git -C $testroot/repo2 commit -q -a -m 'modified a submodule'
# Update the repo/repo2 submodule link
- (cd $testroot/repo && git -C repo2 pull -q)
- (cd $testroot/repo && git add repo2)
+ git -C $testroot/repo/repo2 pull -q
+ git -C $testroot/repo add repo2
git_commit $testroot/repo -m "changed submodule link"
# log -P does not show the changed submodule path
blob - a7908e3851266c3fe538eb4321c3fab455fc0d8d
blob + dbe3024c2ef524f9153d2084c07158bbf936910e
--- regress/cmdline/merge.sh
+++ regress/cmdline/merge.sh
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing beta on newbranch"
local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "adding new file on newbranch"
local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
- (cd $testroot/repo && ln -s alpha symlink && git add symlink)
+ (cd $testroot/repo && ln -s alpha symlink)
+ git -C $testroot/repo add symlink
git_commit $testroot/repo -m "adding symlink on newbranch"
local branch_commit4=`git_show_branch_head $testroot/repo newbranch`
(cd $testroot/repo && ln -sf .got/bar dotgotbar.link)
- (cd $testroot/repo && git add dotgotbar.link)
+ git -C $testroot/repo add dotgotbar.link
git_commit $testroot/repo -m "adding a bad symlink on newbranch"
local branch_commit5=`git_show_branch_head $testroot/repo newbranch`
fi
# create a divergent commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
git_commit $testroot/repo -m "common commit"
local commit1=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified beta on branch" > $testroot/repo/beta
git_commit $testroot/repo -m "committing to beta on newbranch"
local commit2=`git_show_head $testroot/repo`
local testroot=`test_init merge_forward_commit`
local commit0=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local commit1=`git_show_head $testroot/repo`
local testroot=`test_init merge_forward_commit`
local commit0=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local commit1=`git_show_head $testroot/repo`
local testroot=`test_init merge_backward`
local commit0=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q -b newbranch
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing beta on newbranch"
local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "adding new file on newbranch"
local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
fi
# create a conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
# changed since the merge was started, to avoid clobbering the changes.
local testroot=`test_init merge_continue_new_commit`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit1=`git_show_branch_head $testroot/repo newbranch`
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing beta on newbranch"
local branch_commit2=`git_show_branch_head $testroot/repo newbranch`
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "adding new file on newbranch"
local branch_commit3=`git_show_branch_head $testroot/repo newbranch`
- (cd $testroot/repo && ln -s alpha symlink && git add symlink)
+ (cd $testroot/repo && ln -s alpha symlink)
+ git -C $testroot/repo add symlink
git_commit $testroot/repo -m "adding symlink on newbranch"
local branch_commit4=`git_show_branch_head $testroot/repo newbranch`
touch $testroot/wt/unversioned-file
# create a conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
fi
# create a conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
fi
# create a conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to alpha and delta"
fi
# create a conflicting commit which renames alpha
- (cd $testroot/repo && git checkout -q master)
- (cd $testroot/repo && git mv alpha epsilon/alpha-moved)
+ git -C $testroot/repo checkout -q master
+ git -C $testroot/repo mv alpha epsilon/alpha-moved
git_commit $testroot/repo -m "moving alpha on master"
local master_commit=`git_show_head $testroot/repo`
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit=`git_show_branch_head $testroot/repo newbranch`
fi
# create a conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
fi
# update the 'files' branch
- (cd $testroot/repo && git reset -q --hard master)
- (cd $testroot/repo && git checkout -q files)
+ git -C $testroot/repo reset -q --hard master
+ git -C $testroot/repo checkout -q files
echo "indeed" > $testroot/repo/indeed
- (cd $testroot/repo && git add indeed)
+ git -C $testroot/repo add indeed
git_commit $testroot/repo -m "adding another file indeed"
echo "be lots and lots of" > $testroot/repo/be/lots/of
git_commit $testroot/repo -m "lots of changes"
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local branch_commit0=`git_show_branch_head $testroot/repo newbranch`
fi
# create a non-conflicting commit
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified beta on master" > $testroot/repo/beta
git_commit $testroot/repo -m "committing to beta on master"
local master_commit=`git_show_head $testroot/repo`
test_merge_umask() {
local testroot=`test_init merge_umask`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" >$testroot/repo/alpha
git_commit "$testroot/repo" -m "committing alpha on newbranch"
echo "modified delta on branch" >$testroot/repo/gamma/delta
git_commit "$testroot/repo" -m "committing delta on newbranch"
# diverge from newbranch
- (cd "$testroot/repo" && git checkout -q master)
+ git -C "$testroot/repo" checkout -q master
echo "modified beta on master" >$testroot/repo/beta
git_commit "$testroot/repo" -m "committing zeto no master"
test_merge_gitconfig_author() {
local testroot=`test_init merge_gitconfig_author`
- (cd $testroot/repo && git config user.name 'Flan Luck')
- (cd $testroot/repo && git config user.email 'flan_luck@openbsd.org')
+ git -C $testroot/repo config user.name 'Flan Luck'
+ git -C $testroot/repo config user.email 'flan_luck@openbsd.org'
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" >$testroot/repo/alpha
git_commit "$testroot/repo" -m "committing alpha on newbranch"
echo "modified delta on branch" >$testroot/repo/gamma/delta
git_commit "$testroot/repo" -m "committing delta on newbranch"
# diverge from newbranch
- (cd "$testroot/repo" && git checkout -q master)
+ git -C "$testroot/repo" checkout -q master
echo "modified beta on master" >$testroot/repo/beta
git_commit "$testroot/repo" -m "committing zeto no master"
blob - f95aac7980de13e20863266dcd1ae971cb702364
blob + d4500f1b7676ed3946c82efc8e8d7f50755569bc
--- regress/cmdline/patch.sh
+++ regress/cmdline/patch.sh
local testroot=`test_init patch_merge_gitdiff`
jot 10 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers && \
- git_commit $testroot/repo -m "nums")
+ git -C $testroot/repo add numbers && \
+ git_commit $testroot/repo -m "nums"
ret=$?
if [ $ret -ne 0 ]; then
test_done $testroot $ret
fi
jot 10 | sed 's/4/four/g' > $testroot/repo/numbers
- (cd $testroot/repo && git diff > $testroot/old.diff)
+ git -C $testroot/repo diff > $testroot/old.diff
ret=$?
if [ $ret -ne 0 ]; then
test_done $testroot $ret
jot 10 > $testroot/repo/numbers
jot 10 | sed 's/6/six/g' > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers && \
- git_commit $testroot/repo -m "edit")
+ git -C $testroot/repo add numbers && \
+ git_commit $testroot/repo -m "edit"
ret=$?
if [ $ret -ne 0 ]; then
test_done $testroot $ret
# try again using a git produced diff
(cd $testroot/wt && got revert x) >/dev/null
- (cd $testroot/repo && git show demo) >$testroot/wt/patch
+ git -C $testroot/repo show demo >$testroot/wt/patch
(cd $testroot/wt && got patch <patch) > $testroot/stdout
if [ $? -ne 0 ]; then
blob - 1d339f654c90ee75c99eac9cc5a7f39e8b6275ce
blob + bec03a3f9a01f0d363aee654100fd1f0280b1d9d
--- regress/cmdline/rebase.sh
+++ regress/cmdline/rebase.sh
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
local orig_author_time2=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got rebase newbranch > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
local new_author_time2=`git_show_author_time $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local newbranch_id=`git_show_head $testroot/repo`
local testroot=`test_init rebase_continue`
local init_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local orig_commit1=`git_show_head $testroot/repo`
local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got unstage alpha > /dev/null)
(cd $testroot/wt && got rebase -c > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_head $testroot/repo`
local short_new_commit1=`trim_obj_id 28 $new_commit1`
local init_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified beta on branch" > $testroot/repo/beta
git_commit $testroot/repo -m "committing to beta on newbranch"
local orig_commit1=`git_show_head $testroot/repo`
echo "modified alpha on branch" > $testroot/repo/alpha
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo \
-m "changing alpha and adding new on newbranch"
local orig_commit2=`git_show_head $testroot/repo`
local short_orig_commit2=`trim_obj_id 28 $orig_commit2`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got rebase -a > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
echo "Switching work tree to refs/heads/master" \
> $testroot/stdout.expected
local testroot=`test_init rebase_no_op_change`
local init_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local orig_commit1=`git_show_head $testroot/repo`
local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got rebase -c > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_head $testroot/repo`
echo -n "$short_orig_commit1 -> no-op change" \
local testroot=`test_init rebase_in_progress`
local init_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on newbranch"
local orig_commit1=`git_show_head $testroot/repo`
local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
test_rebase_path_prefix() {
local testroot=`test_init rebase_path_prefix`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt2 && got rebase newbranch \
> $testroot/stdout 2> $testroot/stderr)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
test_rebase_preserves_logmsg() {
local testroot=`test_init rebase_preserves_logmsg`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "modified delta on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got rebase newbranch > /dev/null \
2> $testroot/stderr)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
local testroot=`test_init rebase_out_of_date`
local initial_commit=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit1=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified beta on master" > $testroot/repo/beta
git_commit $testroot/repo -m "committing to beta on master"
local master_commit2=`git_show_head $testroot/repo`
test_rebase_trims_empty_dir() {
local testroot=`test_init rebase_trims_empty_dir`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
- (cd $testroot/repo && git rm -q epsilon/zeta)
+ git -C $testroot/repo rm -q epsilon/zeta
git_commit $testroot/repo -m "removing zeta on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified alpha on master" > $testroot/repo/alpha
git_commit $testroot/repo -m "committing to alpha on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got rebase newbranch > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
mkdir -p $testroot/repo/d/f/g
echo "new file" > $testroot/repo/d/f/g/new
- (cd $testroot/repo && git add d/f/g/new)
+ git -C $testroot/repo add d/f/g/new
git_commit $testroot/repo -m "adding a subdir"
local commit0=`git_show_head $testroot/repo`
(cd $testroot/wt && got commit \
-m "removing beta and d/f/g/new on newbranch" > /dev/null)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
(cd $testroot/wt && got commit \
-m "removing beta and d/f/g/new on master" > /dev/null)
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && got update -b master > /dev/null)
return 1
fi
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_head $testroot/repo`
local short_new_commit1=`trim_obj_id 28 $new_commit1`
test_rebase_rm_add_rm_file() {
local testroot=`test_init rebase_rm_add_rm_file`
- (cd $testroot/repo && git checkout -q -b newbranch)
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo checkout -q -b newbranch
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing beta from newbranch"
local orig_commit1=`git_show_head $testroot/repo`
echo 'restored beta' > $testroot/repo/beta
- (cd $testroot/repo && git add beta)
+ git -C $testroot/repo add beta
git_commit $testroot/repo -m "restoring beta on newbranch"
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing beta from newbranch again"
local orig_commit3=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit3=`git_show_head $testroot/repo`
local new_commit2=`git_show_parent_commit $testroot/repo`
local new_commit1=`git_show_parent_commit $testroot/repo $new_commit2`
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local short_orig_commit1=`trim_obj_id 28 $orig_commit1`
local short_orig_commit2=`trim_obj_id 28 $orig_commit2`
local commit0_author_time=`git_show_author_time $testroot/repo`
local committer="Flan Luck <flan_luck@openbsd.org>"
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local orig_commit2=`git_show_head $testroot/repo`
local orig_author_time2=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
(cd $testroot/wt && env GOT_AUTHOR="$committer" \
got rebase newbranch > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
local new_author_time2=`git_show_author_time $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
local committer="$GOT_AUTHOR"
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local orig_commit2=`git_show_head $testroot/repo`
local orig_author_time2=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
(unset GOT_AUTHOR && cd $testroot/wt && \
got rebase newbranch > $testroot/stdout)
- (cd $testroot/repo && git checkout -q newbranch)
+ git -C $testroot/repo checkout -q newbranch
local new_commit1=`git_show_parent_commit $testroot/repo`
local new_commit2=`git_show_head $testroot/repo`
local new_author_time2=`git_show_author_time $testroot/repo`
local commit0=`git_show_head $testroot/repo`
local commit0_author_time=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
local orig_commit2=`git_show_head $testroot/repo`
local orig_author_time2=`git_show_author_time $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
blob - 0dcbb993cdc019b50ced407fa75909e73e435526
blob + f19cabc30854c8e77db6d827d2b8ed078c8362f5
--- regress/cmdline/ref.sh
+++ regress/cmdline/ref.sh
fi
# Ensure that Git recognizes the ref Got has created
- (cd $testroot/repo && git checkout -q newref)
+ git -C $testroot/repo checkout -q newref
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q anotherref)
+ git -C $testroot/repo checkout -q anotherref
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q symbolicref)
+ git -C $testroot/repo checkout -q symbolicref
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
fi
# Ensure that Git recognizes the ref Got has created
- (cd $testroot/repo && git checkout -q HEAD)
+ git -C $testroot/repo checkout -q HEAD
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git pack-refs --all)
+ git -C $testroot/repo pack-refs --all
echo "modified alpha" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha"
blob - dcea98961cf673717907f69c3761b59218c16e1a
blob + 9d0663c277f81746a0e748dfa34bab74a5ac65b5
--- regress/cmdline/revert.sh
+++ regress/cmdline/revert.sh
local testroot=`test_init revert_patch`
jot 16 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local commit_id=`git_show_head $testroot/repo`
local testroot=`test_init revert_patch_one_change`
jot 16 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local commit_id=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta2.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
blob - 420392d1edc3385a27c85335dea42848d6627aa0
blob + 8ee0c9db46392914b731af78dcd15c1cc3684308
--- regress/cmdline/rm.sh
+++ regress/cmdline/rm.sh
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
got checkout $testroot/repo $testroot/wt > /dev/null
blob - 95122a61da8bdfe16b530a54988fda3e5870a4ee
blob + 522e20e74edf14f00ee8062462c8e07e0fa3a63c
--- regress/cmdline/send.sh
+++ regress/cmdline/send.sh
| tr -d ' ' | cut -d: -f2`
echo "modified alpha" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
- (cd $testroot/repo && ln -s epsilon/zeta symlink && git add symlink)
+ git -C $testroot/repo rm -q beta
+ (cd $testroot/repo && ln -s epsilon/zeta symlink)
+ git -C $testroot/repo add symlink
echo "new file alpha" > $testroot/repo/new
- (cd $testroot/repo && git add new)
+ git -C $testroot/repo add new
git_commit $testroot/repo -m "modified alpha"
local commit_id2=`git_show_head $testroot/repo`
return 1
fi
- (cd $testroot/repo && git config receive.denyCurrentBranch ignore)
+ git -C $testroot/repo config receive.denyCurrentBranch ignore
got send -q -r $testroot/repo-clone
ret=$?
local testurl=ssh://127.0.0.1/$testroot
local commit_id=`git_show_head $testroot/repo`
- (cd $testroot/repo && git config receive.denyCurrentBranch ignore)
+ git -C $testroot/repo config receive.denyCurrentBranch ignore
got clone -q $testurl/repo $testroot/repo-clone
ret=$?
local testurl=ssh://127.0.0.1/$testroot
local commit_id=`git_show_head $testroot/repo`
- (cd $testroot/repo && git config receive.denyCurrentBranch ignore)
+ git -C $testroot/repo config receive.denyCurrentBranch ignore
got clone -q $testurl/repo $testroot/repo-clone
ret=$?
local testurl=ssh://127.0.0.1/$testroot
local commit_id=`git_show_head $testroot/repo`
- (cd $testroot/repo && git config receive.denyCurrentBranch ignore)
+ git -C $testroot/repo config receive.denyCurrentBranch ignore
got clone -q $testurl/repo $testroot/repo-clone
ret=$?
blob - 76716f5e5237ac2f3426c566633ec858be31881e
blob + 7152f7a681f0e4db92a9a9a549bf0079ed7b9f59
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
(cd $testroot/wt && got stage alpha > /dev/null)
echo "modified alpha on master" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on master" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing changes"
local old_commit1=`git_show_head $testroot/repo`
test_stage_rebase() {
local testroot=`test_init stage_rebase`
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified delta on branch" > $testroot/repo/gamma/delta
git_commit $testroot/repo -m "committing to delta on newbranch"
echo "modified alpha on branch" > $testroot/repo/alpha
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
echo "new file on branch" > $testroot/repo/epsilon/new
- (cd $testroot/repo && git add epsilon/new)
+ git -C $testroot/repo add epsilon/new
git_commit $testroot/repo -m "committing more changes on newbranch"
local orig_commit1=`git_show_parent_commit $testroot/repo`
local orig_commit2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git checkout -q master)
+ git -C $testroot/repo checkout -q master
echo "modified zeta on master" > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "committing to zeta on master"
local master_commit=`git_show_head $testroot/repo`
local testroot=`test_init stage_patch`
jot 16 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local commit_id=`git_show_head $testroot/repo`
local testroot=`test_init stage_patch_twice`
jot 16 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local commit_id=`git_show_head $testroot/repo`
jot 16 > $testroot/repo/numbers
echo zzz > $testroot/repo/zzz
- (cd $testroot/repo && git add numbers zzz)
+ git -C $testroot/repo add numbers zzz
git_commit $testroot/repo -m "added files"
local commit_id=`git_show_head $testroot/repo`
jot 16 > $testroot/repo/numbers
echo zzz > $testroot/repo/zzz
- (cd $testroot/repo && git add numbers zzz)
+ git -C $testroot/repo add numbers zzz
git_commit $testroot/repo -m "added files"
local commit_id=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local head_commit=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local head_commit=`git_show_head $testroot/repo`
blob - 28da1dacd8934b690da5ceef71b0f51b9bcb8c87
blob + 13623342bf573588e2acc70fdd73ada54e46965e
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
touch $testroot/repo/Basic/Targets/AArch64.cpp
touch $testroot/repo/Basic/Targets.cpp
touch $testroot/repo/Basic/Targets.h
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add subdir with files"
got checkout $testroot/repo $testroot/wt > /dev/null
mkdir $testroot/repo/FrontendTool
touch $testroot/repo/FrontendTool/CMakeLists.txt
touch $testroot/repo/FrontendTool/ExecuteCompilerInvocation.cpp
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add subdir with files"
got checkout $testroot/repo $testroot/wt > /dev/null
echo "6" >> $testroot/repo/numbers
echo "7" >> $testroot/repo/numbers
echo "8" >> $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
got checkout $testroot/repo $testroot/wt > /dev/null
mkdir $testroot/repo/ramdisk_cd/
touch $testroot/repo/ramdisk_cd/Makefile
touch $testroot/repo/ramdisk_cd/list.local
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "first commit"
got checkout $testroot/repo $testroot/wt > /dev/null
(cd $testroot/repo && ln -s alpha alpha.link)
(cd $testroot/repo && ln -s epsilon epsilon.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "first commit"
got checkout $testroot/repo $testroot/wt > /dev/null
# make this file larger than the usual blob buffer size of 8192
jot 16384 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
got checkout $testroot/repo $testroot/wt > /dev/null
echo "6" >> $testroot/repo/numbers
echo "7" >> $testroot/repo/numbers
echo "8" >> $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
got checkout $testroot/repo $testroot/wt > /dev/null
blob - 58cc28c89680ed685a25bf71155506a5c55715a3
blob + 005a6304020f8cb434ecb6fb450d1b44d9bcc66e
--- regress/cmdline/tag.sh
+++ regress/cmdline/tag.sh
fi
# Ensure that Git recognizes the tag Got has created
- (cd $testroot/repo && git checkout -q $tag)
+ git -C $testroot/repo checkout -q $tag
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
return 1
fi
- (cd $testroot/repo && git checkout -q $tag2)
+ git -C $testroot/repo checkout -q $tag2
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
local tag2=2.0.0
# create tag with Git
- (cd $testroot/repo && git tag -a -m 'test' $tag)
+ git -C $testroot/repo tag -a -m 'test' $tag
# create tag with Got
(cd $testroot/repo && got tag -m 'test' $tag2 > /dev/null)
local tag2=2.0.0
# create "lightweight" tag with Git
- (cd $testroot/repo && git tag $tag)
- (cd $testroot/repo && git tag $tag2)
+ git -C $testroot/repo tag $tag
+ git -C $testroot/repo tag $tag2
tag_id=`got ref -r $testroot/repo -l \
| grep "^refs/tags/$tag" | tr -d ' ' | cut -d: -f2`
echo -n > $testroot/revoked_signers
# Ensure that Git recognizes and verifies the tag Got has created
- (cd $testroot/repo && git checkout -q $tag)
+ git -C $testroot/repo checkout -q $tag
ret=$?
if [ $ret -ne 0 ]; then
echo "git checkout command failed unexpectedly"
test_done "$testroot" "$ret"
return 1
fi
- (cd $testroot/repo && git config --local gpg.ssh.allowedSignersFile \
- $testroot/allowed_signers)
- GIT_STDERR=$(cd $testroot/repo && git tag -v $tag 2>&1 1>/dev/null)
+ git -C $testroot/repo config --local gpg.ssh.allowedSignersFile \
+ $testroot/allowed_signers
+ GIT_STDERR=$(git -C $testroot/repo tag -v $tag 2>&1 1>/dev/null)
if ! echo "$GIT_STDERR" | grep -q "^$GOOD_SIG"; then
echo "git tag command failed to validate signature"
test_done "$testroot" "1"
blob - 62eb987ba62876f4026cd0d830472dd2a3060c20
blob + 1b2025992be4d03420f106db1af5777b5bb84907
--- regress/cmdline/tree.sh
+++ regress/cmdline/tree.sh
local testroot=`test_init tree_submodule`
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
local submodule_id=$(got tree -r $testroot/repo -i | \
grep 'repo2\$$' | cut -d ' ' -f1)
test_tree_submodule_of_same_repo() {
local testroot=`test_init tree_submodule_of_same_repo`
- (cd $testroot && git clone -q repo repo2 >/dev/null)
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot clone -q repo repo2 >/dev/null
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
# Currently fails with "bad object data"
got tree -r $testroot/repo repo2 > $testroot/stdout 2> $testroot/stderr
blob - f5ebd5bc9adac2a53e2651879adde02156aa7f10
blob + f3dca3415655e74d6079b22ae72d395f55d890eb
--- regress/cmdline/unstage.sh
+++ regress/cmdline/unstage.sh
local testroot=`test_init unstage_patch`
jot 16 > $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local commit_id=`git_show_head $testroot/repo`
jot 16 > $testroot/repo/numbers
echo zzz > $testroot/repo/zzz
- (cd $testroot/repo && git add numbers zzz)
+ git -C $testroot/repo add numbers zzz
git_commit $testroot/repo -m "added files"
local commit_id=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local head_commit=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta2.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
blob - 812f69b2eacd6f0c5c490042706348d24de55019
blob + 29f71c104f547b33dd50e328e706ea79dd710fba
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
fi
echo "new" > $testroot/repo/gamma/new
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a new file"
echo "A gamma/new" > $testroot/stdout.expected
mkdir $testroot/repo/epsilon/psi
echo mu > $testroot/repo/epsilon/psi/mu
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
# check out the epsilon/ sub-tree
echo mu > $testroot/repo/epsilon/psi/mu
mkdir $testroot/repo/epsilon/psi/chi
echo tau > $testroot/repo/epsilon/psi/chi/tau
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
# check out the epsilon/ sub-tree
mkdir $testroot/repo/epsilon2
echo mu > $testroot/repo/epsilon2/mu
- (cd $testroot/repo && git add epsilon2/mu)
+ git -C $testroot/repo add epsilon2/mu
git_commit $testroot/repo -m "adding sibling of epsilon"
echo change > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "changing epsilon/zeta"
fi
echo text > $testroot/repo/epsilon.txt
- (cd $testroot/repo && git add epsilon.txt)
+ git -C $testroot/repo add epsilon.txt
git_commit $testroot/repo -m "adding sibling of epsilon"
echo change > $testroot/repo/epsilon/zeta
git_commit $testroot/repo -m "changing epsilon/zeta"
echo mu > $testroot/repo/epsilon/psi/mu
mkdir $testroot/repo/epsilon/psi/chi
echo tau > $testroot/repo/epsilon/psi/chi/tau
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
got checkout $testroot/repo $testroot/wt > /dev/null
return 1
fi
- (cd $testroot/repo && git mv epsilon/psi/mu epsilon/mu)
- (cd $testroot/repo && git mv epsilon/psi/chi/tau epsilon/psi/tau)
+ git -C $testroot/repo mv epsilon/psi/mu epsilon/mu
+ git -C $testroot/repo mv epsilon/psi/chi/tau epsilon/psi/tau
git_commit $testroot/repo -m "moving files upwards"
echo "A epsilon/mu" > $testroot/stdout.expected
echo mu > $testroot/repo/epsilon/psi/mu
mkdir $testroot/repo/epsilon/psi/chi
echo tau > $testroot/repo/epsilon/psi/chi/tau
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a sub-directory beneath epsilon"
got checkout $testroot/repo $testroot/wt > /dev/null
fi
mkdir -p $testroot/repo/epsilon-new/psi
- (cd $testroot/repo && git mv epsilon/psi/mu epsilon-new/mu)
- (cd $testroot/repo && git mv epsilon/psi/chi/tau epsilon-new/psi/tau)
+ git -C $testroot/repo mv epsilon/psi/mu epsilon-new/mu
+ git -C $testroot/repo mv epsilon/psi/chi/tau epsilon-new/psi/tau
git_commit $testroot/repo -m "moving files upwards"
echo "D epsilon/psi/chi/tau" > $testroot/stdout.expected
touch $testroot/repo/Makefile
touch $testroot/repo/snake.6
touch $testroot/repo/snake.c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding initial snake tree"
got checkout $testroot/repo $testroot/wt > /dev/null
fi
mkdir -p $testroot/repo/snake
- (cd $testroot/repo && git mv Makefile snake.6 snake.c snake)
+ git -C $testroot/repo mv Makefile snake.6 snake.c snake
touch $testroot/repo/snake/move.c
touch $testroot/repo/snake/pathnames.h
touch $testroot/repo/snake/snake.h
mkdir -p $testroot/repo/snscore
touch $testroot/repo/snscore/Makefile
touch $testroot/repo/snscore/snscore.c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "restructuring snake tree"
echo "D Makefile" > $testroot/stdout.expected
touch $testroot/repo/Makefile
touch $testroot/repo/snake.6
touch $testroot/repo/snake.c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding initial snake tree"
got checkout $testroot/repo $testroot/wt > /dev/null
fi
mkdir -p $testroot/repo/sss/snake
- (cd $testroot/repo && git mv Makefile snake.6 snake.c sss/snake)
+ git -C $testroot/repo mv Makefile snake.6 snake.c sss/snake
touch $testroot/repo/sss/snake/move.c
touch $testroot/repo/sss/snake/pathnames.h
touch $testroot/repo/sss/snake/snake.h
mkdir -p $testroot/repo/snscore
touch $testroot/repo/snscore/Makefile
touch $testroot/repo/snscore/snscore.c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "restructuring snake tree"
echo "D Makefile" > $testroot/stdout.expected
touch $testroot/repo/altq/if_altq.h
mkdir -p $testroot/repo/arch/alpha
touch $testroot/repo/arch/alpha/Makefile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding initial tree"
got checkout $testroot/repo $testroot/wt > /dev/null
fi
echo change > $testroot/repo/arch/alpha/Makefile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "changed a file"
echo "U arch/alpha/Makefile" > $testroot/stdout.expected
git_rm $testroot/repo alpha
mkdir $testroot/repo/alpha
echo eta > $testroot/repo/alpha/eta
- (cd $testroot/repo && git add alpha/eta)
+ git -C $testroot/repo add alpha/eta
git_commit $testroot/repo -m "changed alpha into directory"
(cd $testroot/wt && got update > $testroot/stdout 2> $testroot/stderr)
git_rmdir $testroot/repo epsilon
echo epsilon > $testroot/repo/epsilon
cp $testroot/repo/epsilon $testroot/content.expected
- (cd $testroot/repo && git add epsilon)
+ git -C $testroot/repo add epsilon
git_commit $testroot/repo -m "changed epsilon into file"
(cd $testroot/wt && got update > $testroot/stdout 2> $testroot/stderr)
git_rm $testroot/repo alpha
mkdir $testroot/repo/alpha
echo eta > $testroot/repo/alpha/eta
- (cd $testroot/repo && git add alpha/eta)
+ git -C $testroot/repo add alpha/eta
git_commit $testroot/repo -m "changed alpha into directory"
echo "modified alpha" >> $testroot/wt/alpha
echo "6" >> $testroot/repo/numbers
echo "7" >> $testroot/repo/numbers
echo "8" >> $testroot/repo/numbers
- (cd $testroot/repo && git add numbers)
+ git -C $testroot/repo add numbers
git_commit $testroot/repo -m "added numbers file"
local base_commit=`git_show_head $testroot/repo`
touch $testroot/repo/xfile
chmod +x $testroot/repo/xfile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding executable file"
got checkout $testroot/repo $testroot/wt > $testroot/stdout
touch $testroot/repo/xfile
chmod +x $testroot/repo/xfile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding executable file"
got checkout $testroot/repo $testroot/wt > $testroot/stdout
fi
echo "new" > $testroot/repo/gamma/new
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding a new file"
echo "also new" > $testroot/wt/gamma/new
return 1
fi
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing a file"
echo "modified beta" > $testroot/wt/beta
return 1
fi
- (cd $testroot/repo && git rm -q beta)
+ git -C $testroot/repo rm -q beta
git_commit $testroot/repo -m "removing a file"
(cd $testroot/wt && got rm beta > /dev/null)
echo "new" > $testroot/repo/new
echo "epsilon/new2" > $testroot/repo/epsilon/new2
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "added two files"
echo "A epsilon/new2" > $testroot/stdout.expected
return 1
fi
- (cd $testroot/repo && git rm -q alpha epsilon/zeta)
+ git -C $testroot/repo rm -q alpha epsilon/zeta
git_commit $testroot/repo -m "removed two files"
echo "got: /alpha: no such entry found in tree" \
(cd $testroot/wt && got commit -m "modified alpha with got" > /dev/null)
# + xxxxxxx...yyyyyyy master -> master (forced update)
- (cd $testroot/repo2 && git fetch -q --all)
+ git -C $testroot/repo2 fetch -q --all
echo -n > $testroot/stdout.expected
echo -n "got: work tree's head reference now points to a different " \
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on new branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha on new branch"
return 1
fi
- (cd $testroot/repo && git checkout -q -b newbranch)
+ git -C $testroot/repo checkout -q -b newbranch
echo "modified alpha on new branch" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha on new branch"
local testroot=`test_init update_bumps_base_commit_id`
echo "psi" > $testroot/repo/epsilon/psi
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding another file"
got checkout $testroot/repo $testroot/wt > /dev/null
fi
echo "changed zeta with git" > $testroot/repo/epsilon/zeta
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "changing zeta with git"
echo "modified zeta" > $testroot/wt/epsilon/zeta
echo "modified alpha" > $testroot/repo/alpha
git_commit $testroot/repo -m "modified alpha"
- (cd $testroot/repo && git tag -m "test" -a $tag)
+ git -C $testroot/repo tag -m "test" -a $tag
echo "U alpha" > $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
touch $testroot/repo/xfile
chmod +x $testroot/repo/xfile
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding executable file"
local commit_id1=`git_show_head $testroot/repo`
make_single_file_repo $testroot/repo2 foo
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
got checkout $testroot/repo $testroot/wt > /dev/null
echo "modified foo" > $testroot/repo2/foo
- (cd $testroot/repo2 && git commit -q -a -m 'modified a submodule')
+ git -C $testroot/repo2 commit -q -a -m 'modified a submodule'
# Update the repo/repo2 submodule link
- (cd $testroot/repo && git -C repo2 pull -q)
- (cd $testroot/repo && git add repo2)
+ git -C $testroot/repo/repo2 pull -q
+ git -C $testroot/repo add repo2
git_commit $testroot/repo -m "modified submodule link"
echo "Already up-to-date" > $testroot/stdout.expected
make_single_file_repo $testroot/repo2 foo
echo "modified foo" > $testroot/repo2/foo
- (cd $testroot/repo2 && git commit -q -a -m 'modified a submodule')
+ git -C $testroot/repo2 commit -q -a -m 'modified a submodule'
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
echo "A .gitmodules" > $testroot/stdout.expected
echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected
return 1
fi
- (cd $testroot/repo && git -c protocol.file.allow=always \
- submodule -q add ../repo2)
- (cd $testroot/repo && git commit -q -m 'adding submodule')
+ git -C $testroot/repo -c protocol.file.allow=always \
+ submodule -q add ../repo2
+ git -C $testroot/repo commit -q -m 'adding submodule'
# Modify the clashing file such that any modifications brought
# in by 'got update' would require a merge.
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
echo "A alpha.link" > $testroot/stdout.expected
local testroot=`test_init update_deletes_symlink`
(cd $testroot/repo && ln -s alpha alpha.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlink"
got checkout $testroot/repo $testroot/wt > /dev/null
return 1
fi
- (cd $testroot/repo && git rm -q alpha.link)
+ git -C $testroot/repo rm -q alpha.link
git_commit $testroot/repo -m "delete symlink"
echo "D alpha.link" > $testroot/stdout.expected
(cd $testroot/repo && ln -s ../beta epsilon/beta.link)
(cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && ln -sf epsilon/zeta zeta.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add symlinks"
local commit_id1=`git_show_head $testroot/repo`
(cd $testroot/repo && ln -sf ../gamma/delta epsilon/beta.link)
echo 'this is regular file foo' > $testroot/repo/dotgotfoo.link
(cd $testroot/repo && ln -sf .got/bar dotgotbar.link)
- (cd $testroot/repo && git rm -q nonexistent.link)
+ git -C $testroot/repo rm -q nonexistent.link
(cd $testroot/repo && ln -sf gamma/delta zeta.link)
(cd $testroot/repo && ln -sf alpha new.link)
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "change symlinks"
local commit_id2=`git_show_head $testroot/repo`
local testroot=`test_init update_single_file 1`
echo c1 > $testroot/repo/c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "adding file c"
local commit_id1=`git_show_head $testroot/repo`
echo a > $testroot/repo/a
echo b > $testroot/repo/b
echo c2 > $testroot/repo/c
- (cd $testroot/repo && git add .)
+ git -C $testroot/repo add .
git_commit $testroot/repo -m "add files a and b, change c"
local commit_id2=`git_show_head $testroot/repo`
- (cd $testroot/repo && git rm -qf c)
+ git -C $testroot/repo rm -qf c
git_commit $testroot/repo -m "remove file c"
local commit_id3=`git_show_head $testroot/repo`
echo "changed beta" > $testroot/repo/beta
echo "new file" > $testroot/repo/new
- (cd $testroot/repo && git add new)
+ git -C $testroot/repo add new
git_commit $testroot/repo -m "changed beta"
local commit_id1=`git_show_head $testroot/repo`
blob_id1=`get_blob_id $testroot/repo "" beta`