Skip to content

Commit d497871

Browse files
committed
t2400, t5516: strip directory prefix from --git-dir path arguments
Earlier commits replaced `-C <dir>` with `--git-dir=<dir>` as part of the `safe.bareRepository` preparation. Since `--git-dir` does not change the working directory, paths that duplicated the directory name as a prefix are now redundant. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 2f507db commit d497871

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

t/t2400-worktree-add.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ test_expect_success '"add --orphan" with empty repository' '
404404
test_when_finished "rm -rf empty_repo" &&
405405
echo refs/heads/newbranch >expected &&
406406
GIT_DIR="empty_repo" git init --bare &&
407-
git -C empty_repo worktree add --orphan -b newbranch worktreedir &&
407+
git --git-dir=empty_repo worktree add --orphan -b newbranch empty_repo/worktreedir &&
408408
git -C empty_repo/worktreedir symbolic-ref HEAD >actual &&
409409
test_cmp expected actual
410410
'

t/t5516-fetch-push.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ test_expect_success 'denyCurrentBranch and worktrees' '
18061806
test_expect_success 'denyCurrentBranch and bare repository worktrees' '
18071807
test_when_finished "rm -fr bare.git" &&
18081808
git clone --bare . bare.git &&
1809-
git -C bare.git worktree add wt &&
1809+
git --git-dir=bare.git worktree add bare.git/wt &&
18101810
test_commit grape &&
18111811
git -C bare.git config receive.denyCurrentBranch refuse &&
18121812
test_must_fail git push bare.git HEAD:wt &&
@@ -1827,7 +1827,7 @@ test_expect_success 'refuse fetch to current branch of worktree' '
18271827
test_expect_success 'refuse fetch to current branch of bare repository worktree' '
18281828
test_when_finished "rm -fr bare.git" &&
18291829
git clone --bare . bare.git &&
1830-
git -C bare.git worktree add wt &&
1830+
git --git-dir=bare.git worktree add bare.git/wt &&
18311831
test_commit banana &&
18321832
test_must_fail git -C bare.git fetch .. HEAD:wt &&
18331833
git -C bare.git fetch -u .. HEAD:wt

0 commit comments

Comments
 (0)