Re: [PATCH v2 3/8] refs: new ref types to make per-worktree refs visible to all worktrees
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 7, 2018, 01:37 UTC
- Message-ID
- <xmqqva6etu3n.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180929191029.13994-4-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 14 quoted lines
> diff --git a/refs/files-backend.c b/refs/files-backend.c
> index 2dd77f9485..9ca2a3706c 100644
> --- a/refs/files-backend.c
> +++ b/refs/files-backend.c
> ...
> case REF_TYPE_PSEUDOREF:
> strbuf_addf(sb, "%s/logs/%s", refs->gitdir, refname);
> break;
> + case REF_TYPE_OTHER_PSEUDOREF:
> + return files_reflog_path_other_worktrees(refs, sb, refname);
> + case REF_TYPE_MAIN_PSEUDOREF:
> + if (!skip_prefix(refname, "main-worktree/", &refname))
> + BUG("ref %s is not a main pseudoref", refname);
> + /* passthru */Correct spelling of the colloquial phrase is fallthru, but see 1cf01a34 ("consistently use "fallthrough" comments in switches", 2017-09-21) that encourages use of "fallthrough" fully spelled out.
Otherwise you'd see something like this.
CC refs/files-backend.o
refs/files-backend.c: In function 'files_ref_path':
refs/files-backend.c:203:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (!skip_prefix(refname, "main-worktree/", &refname))
^
refs/files-backend.c:206:2: note: here
case REF_TYPE_OTHER_PSEUDOREF:
^~~~
refs/files-backend.c: In function 'files_reflog_path':
refs/files-backend.c:181:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (!skip_prefix(refname, "main-worktree/", &refname))
^
refs/files-backend.c:184:2: note: here
case REF_TYPE_NORMAL:
^~~~
cc1: all warnings being treated as errors
Makefile:2289: recipe for target 'refs/files-backend.o' failed
make: *** [refs/files-backend.o] Error 1