From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-6.3 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 194661F953 for ; Tue, 9 Nov 2021 23:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240198AbhKIXGs (ORCPT ); Tue, 9 Nov 2021 18:06:48 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52045 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230221AbhKIXGs (ORCPT ); Tue, 9 Nov 2021 18:06:48 -0500 Received: from [192.168.9.206] (198-27-191-186.fiber.dynamic.sonic.net [198.27.191.186]) (authenticated bits=0) (User authenticated as andersk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 1A9N3oGu012984 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 9 Nov 2021 18:03:51 -0500 Message-ID: <2f983e36-532f-ac87-9ade-fba4c6b9d276@mit.edu> Date: Tue, 9 Nov 2021 15:03:49 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v4 3/4] receive-pack: Protect current branch for bare repository worktree Content-Language: en-US To: Johannes Schindelin Cc: Junio C Hamano , Jeff King , git@vger.kernel.org, Andreas Heiduk References: <20211109030028.2196416-1-andersk@mit.edu> <20211109030028.2196416-3-andersk@mit.edu> From: Anders Kaseorg In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 11/9/21 08:22, Johannes Schindelin wrote: > While `find_shared_symref()` currently won't return a `worktree` with a > non-zero `is_bare`, to future-proof the code we might want to turn the > `if (worktree)` below (8 lines outside the current diff context) into `if > (worktree && !worktree->is_bare)`. Will do. >> +test_expect_success 'denyCurrentBranch and bare repository worktrees' ' >> + test_when_finished "rm -fr bare.git" && > > While `wt/` will be created inside `bare.git` and therefore be removed, > the branch `wt` won't. Maybe add `&& git branch -D wt`? The branch ‘wt’ is inside bare.git. > I like fruit, too! Apple, banana, grape, yummy. I wonder what's next :-) Yay! > Maybe make sure that `bare.git/wt/grape.t` exists? We do want the worktree > to be updated, after all... Right, I’d forgotten this one. Will do. Thanks all for the helpful reviews! Anders