Re: [PATCH v5 4/4] worktree add: Add hint to use --orphan when bad ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jacob Abel <jacobabel@xxxxxxxxxx> writes:

> Subject: Re: [PATCH v5 4/4] worktree add: Add hint to use --orphan when bad ref

Incomplete sentence that invites "when bad ref, what?"

> +			"	git worktree add --orphan %s %s\n"), new_branch, path

OK.  "git worktree add -b <name-of-branch> <path>" is how you create
a worktree and have it on a named branch.  And instead of saying -b, 
you would say --orphan.  This sounds like a fairly easy-to-understand
parallel to how "git checkout [-b/-B/--orphan] name-of-branch" takes
its parameters.

> +test_wt_add_empty_repo_orphan_hint() {
> +	local context="$1"
> +	shift
> +	local opts="$@"
> +	test_expect_success "'worktree add' show orphan hint in empty repo w/ $context" '
> +		test_when_finished "rm -rf empty_repo" &&
> +		GIT_DIR="empty_repo" git init --bare &&
> +		test_must_fail git -C empty_repo worktree add $opts foobar/ 2> actual &&

The comments on "$@" (vs "$*") in an earlier step equally applies here.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux