Merge branch 'es/worktree-forced-ops-fix'
Fix a bug in which the same path could be registered under multiple worktree entries if the path was missing (for instance, was removed manually). Also, as a convenience, expand the number of cases in which --force is applicable. * es/worktree-forced-ops-fix: doc-diff: force worktree add worktree: delete .git/worktrees if empty after 'remove' worktree: teach 'remove' to override lock when --force given twice worktree: teach 'move' to override lock when --force given twice worktree: teach 'add' to respect --force for registered but missing path worktree: disallow adding same path multiple times worktree: prepare for more checks of whether path can become worktree worktree: generalize delete_git_dir() to reduce code duplication worktree: move delete_git_dir() earlier in file for upcoming new callers worktree: don't die() in library function find_worktree()
This commit is contained in:
@ -75,7 +75,7 @@ fi
|
||||
# results that don't differ between the two trees.
|
||||
if ! test -d "$tmp/worktree"
|
||||
then
|
||||
git worktree add --detach "$tmp/worktree" "$from" &&
|
||||
git worktree add -f --detach "$tmp/worktree" "$from" &&
|
||||
dots=$(echo "$tmp/worktree" | sed 's#[^/]*#..#g') &&
|
||||
ln -s "$dots/config.mak" "$tmp/worktree/config.mak"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user