Re: [PATCH v5 4/4] branch: Protect branches checked out in all worktrees

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

 



On Tue, Nov 09 2021, Anders Kaseorg wrote:

> [...]
>  	if (!validate_branchname(name, ref))
>  		return 0;
> @@ -208,9 +208,11 @@ int validate_new_branchname(const char *name, struct strbuf *ref, int force)
>  		die(_("A branch named '%s' already exists."),
>  		    ref->buf + strlen("refs/heads/"));
>  
> -	head = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
> -	if (!is_bare_repository() && head && !strcmp(head, ref->buf))
> -		die(_("Cannot force update the current branch."));
> +	wt = find_shared_symref("HEAD", ref->buf);
> +	if (wt && !wt->is_bare)
> +		die(_("Cannot force update the branch '%s'"

die() etc. messages should start with lower-case. See CodingGuidelines.

Here you're changing an existing die() message, but since it's something
translators will need to re-do let's fix it while we're at it.



[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