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=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 738121F5AE for ; Sat, 1 May 2021 18:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232131AbhEAS4O (ORCPT ); Sat, 1 May 2021 14:56:14 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:45601 "EHLO mail-ej1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbhEAS4N (ORCPT ); Sat, 1 May 2021 14:56:13 -0400 Received: by mail-ej1-f42.google.com with SMTP id u3so1914519eja.12 for ; Sat, 01 May 2021 11:55:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4j87D9BeGihiorPYVBxzOv2RzJU43OnhKI8FV8cnmSM=; b=L46w/nUD5B5vYGlufGqthP/q87iteUnyqR+KvQOuZ0DLwwelDtOM0OKHU7LiDEEHzY NEdea16FkkMhol1PzB7Oi9iA6YNDdYT4W1hHAEqBD2Y8cnBkdwPjPvDapuqPgP53v99i HAyfAWfE87Sk0Nu5K7gAqpuKeav39ULyLIwzfT+6SRDHdlNlRtY6m+7fvF8K+qxLp4Wk 664DpWDb37G72PYdLjGOfaar+alfxOi+S/ucbi5ze4wJKAIoYAZhq9LYts6VXL/ORiHP CgiVncIFJdxy0lOVSbfa2SSpnm/bB66V9y3enJZG2el5xCoqdQBwvAncXDbiDAPKuHmK JX8w== X-Gm-Message-State: AOAM533xojZs3hcymQu6XNTolqtQBsYrWSskUS+A/05SY3eX/6iLEAZD Bkz4bzciSwbbXKH6qfxBKoM7po2kYRxJPnr7ib6AJaXglM0= X-Google-Smtp-Source: ABdhPJxxNgynu5v9jQPNVtZt5tP8Lnmwtn2/iNUhuGBMtyWeO+8B0xaBxzXRkccmJqi3yFGvYECOUSBEGFlDGaJ6VZU= X-Received: by 2002:a17:906:edcf:: with SMTP id sb15mr9821714ejb.202.1619895322573; Sat, 01 May 2021 11:55:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Sat, 1 May 2021 14:55:11 -0400 Message-ID: Subject: Re: [PATCH 5/9] t7450: test verify_path() handling of gitmodules To: Jeff King Cc: Git List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, May 1, 2021 at 11:42 AM Jeff King wrote: > Commit 10ecfa7649 (verify_path: disallow symlinks in .gitmodules, > 2018-05-04) made it impossible to load a symlink .gitmodules file into > the index. However, there are no tests of this behavior. Let's make sure > this case is covered. We can easily reuse the test setup created by > the matching b7b1fca175 (fsck: complain when .gitmodules is a symlink, > 2018-05-04). > > Signed-off-by: Jeff King > --- > diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh > @@ -139,7 +139,7 @@ test_expect_success 'index-pack --strict works for non-repo pack' ' > -test_expect_success 'fsck detects symlinked .gitmodules file' ' > +test_expect_success 'set up repo with symlinked .gitmodules file' ' > git init symlink && > ( > cd symlink && > @@ -155,8 +155,14 @@ test_expect_success 'fsck detects symlinked .gitmodules file' ' > { > printf "100644 blob $content\t$tricky\n" && > printf "120000 blob $target\t.gitmodules\n" > - } >bad-tree && > - tree=$(git mktree + } >bad-tree > + ) && > + tree=$(git -C symlink mktree +' `tree` is an unusually generic name for this now-global variable. One can easily imagine it being re-used by some unrelated test arbitrarily inserted into this script, thus potentially breaking the following tests which depend upon it. I wonder if a name such as `BAD_TREE` would be more appropriate.