Merge branch 'nd/setup'
* nd/setup: (47 commits) setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwd git.txt: correct where --work-tree path is relative to Revert "Documentation: always respect core.worktree if set" t0001: test git init when run via an alias Remove all logic from get_git_work_tree() setup: rework setup_explicit_git_dir() setup: clean up setup_discovered_git_dir() t1020-subdirectory: test alias expansion in a subdirectory setup: clean up setup_bare_git_dir() setup: limit get_git_work_tree()'s to explicit setup case only Use git_config_early() instead of git_config() during repo setup Add git_config_early() git-rev-parse.txt: clarify --git-dir t1510: setup case #31 t1510: setup case #30 t1510: setup case #29 t1510: setup case #28 t1510: setup case #27 t1510: setup case #26 t1510: setup case #25 ...
This commit is contained in:
@ -33,6 +33,62 @@ test_expect_success 'plain' '
|
||||
check_config plain/.git false unset
|
||||
'
|
||||
|
||||
test_expect_success 'plain nested in bare' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init --bare bare-ancestor.git &&
|
||||
cd bare-ancestor.git &&
|
||||
mkdir plain-nested &&
|
||||
cd plain-nested &&
|
||||
git init
|
||||
) &&
|
||||
check_config bare-ancestor.git/plain-nested/.git false unset
|
||||
'
|
||||
|
||||
test_expect_success 'plain through aliased command, outside any git repo' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&
|
||||
HOME=$(pwd)/alias-config &&
|
||||
export HOME &&
|
||||
mkdir alias-config &&
|
||||
echo "[alias] aliasedinit = init" >alias-config/.gitconfig &&
|
||||
|
||||
GIT_CEILING_DIRECTORIES=$(pwd) &&
|
||||
export GIT_CEILING_DIRECTORIES &&
|
||||
|
||||
mkdir plain-aliased &&
|
||||
cd plain-aliased &&
|
||||
git aliasedinit
|
||||
) &&
|
||||
check_config plain-aliased/.git false unset
|
||||
'
|
||||
|
||||
test_expect_failure 'plain nested through aliased command' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init plain-ancestor-aliased &&
|
||||
cd plain-ancestor-aliased &&
|
||||
echo "[alias] aliasedinit = init" >>.git/config &&
|
||||
mkdir plain-nested &&
|
||||
cd plain-nested &&
|
||||
git aliasedinit
|
||||
) &&
|
||||
check_config plain-ancestor-aliased/plain-nested/.git false unset
|
||||
'
|
||||
|
||||
test_expect_failure 'plain nested in bare through aliased command' '
|
||||
(
|
||||
unset GIT_DIR GIT_WORK_TREE &&
|
||||
git init --bare bare-ancestor-aliased.git &&
|
||||
cd bare-ancestor-aliased.git &&
|
||||
echo "[alias] aliasedinit = init" >>config &&
|
||||
mkdir plain-nested &&
|
||||
cd plain-nested &&
|
||||
git aliasedinit
|
||||
) &&
|
||||
check_config bare-ancestor-aliased.git/plain-nested/.git false unset
|
||||
'
|
||||
|
||||
test_expect_success 'plain with GIT_WORK_TREE' '
|
||||
if (
|
||||
sane_unset GIT_DIR &&
|
||||
|
Reference in New Issue
Block a user