From patchwork Sat Jul 1 06:48:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuqi Liang X-Patchwork-Id: 13298929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D0D5C0015E for ; Sat, 1 Jul 2023 06:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbjGAGzq (ORCPT ); Sat, 1 Jul 2023 02:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229905AbjGAGzH (ORCPT ); Sat, 1 Jul 2023 02:55:07 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9914B44A6 for ; Fri, 30 Jun 2023 23:48:59 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-3ff24a193dbso20962581cf.3 for ; Fri, 30 Jun 2023 23:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688194138; x=1690786138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qXiHIdG93bLAj5qmq4MzcvVzvjH/AdCV1o8ttPL6ntg=; b=BCI/prcnAMlwVeBPbAnWygSO2QTOA+CWEGO/9EY2KeLW3fcGFQ3af/PdnuwjS+5tRX UVsqejws3AFJtXwbxt6zwLsLef+KA0peyoe96Kj3ptTZV4T1nZEstR+oF32eGyeWmMkL JQGAIimztQUQCD9nue5OHePGZmgVz+13sXMhA5eapGxQoH7aPB1pQf8/2KUNCUjJCFPq wIqYwgxBcilBuSx265dC+5A2BRpwyHzBs/o0EUxfkZbjDE2BNzCXDXtYXsQ7uCT6NgpF 34yY63pp2FMULHPqQvNZJQH+HlbF+/4GrTsLBzv9RCCnxBylEnZEyR/pz+oLuuCrT83u 0Png== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688194138; x=1690786138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qXiHIdG93bLAj5qmq4MzcvVzvjH/AdCV1o8ttPL6ntg=; b=HD3j8zsYicyy7vFmOEPMlsljeWHlHsLFCl5dxb9gftboaig/ufnu9aGfFs1QNgWMkk k3zPYOi0poizHj73iPtGgzZt8ObXjgXw6TxkNorRvVYLSa8kbScE1kdFJ8L0F/WfeVbE kNx+ruRYCBruw1a0Nobt6W6yyRMhudBLZdJFwwK5f56g+enMEJz/Ty+lDnf45Lul40E/ Mnl6AVQIbuk6yIjqynoF6EmIwFau7EnJwKroQ2guLcH8t35S8DYM3tAQ1T35MCyyrJRK 2L70SHwv/WK+ya3l4g5qLhh7YjmwdNvIkgesEQ42lMl12cr9+qorVDg0zxg7nfh5MUKj +tbA== X-Gm-Message-State: AC+VfDxSYuyM6Igc239zTM6YwODuu/0kNrdBJxSLOU/u13xg+Ogd3Tsq Lf9r9Z7tV+wP6d/CkvkBpGZNjtNc4cex5w== X-Google-Smtp-Source: ACHHUZ62J8XUqGWrgeDczR+fGoaowQXefXdjrPqcYsLkFTM3aQzgpNs606tT46//avZr5noequW9Kw== X-Received: by 2002:ac8:5fc7:0:b0:3ec:47d5:ec65 with SMTP id k7-20020ac85fc7000000b003ec47d5ec65mr6236020qta.60.1688194138381; Fri, 30 Jun 2023 23:48:58 -0700 (PDT) Received: from localhost.localdomain (bras-base-london142cw-grc-18-69-158-189-182.dsl.bell.ca. [69.158.189.182]) by smtp.googlemail.com with ESMTPSA id a26-20020ac8435a000000b003e69c51cf53sm2269720qtn.72.2023.06.30.23.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 23:48:58 -0700 (PDT) From: Shuqi Liang To: git@vger.kernel.org Cc: Shuqi Liang , vdye@github.com, gitster@pobox.com Subject: [PATCH v1 1/3] attr.c: read attributes in a sparse directory Date: Sat, 1 Jul 2023 02:48:41 -0400 Message-Id: <20230701064843.147496-2-cheskaqiqi@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230701064843.147496-1-cheskaqiqi@gmail.com> References: <20230701064843.147496-1-cheskaqiqi@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Before this patch,`git check-attr` can't find the attributes of a file within a sparse directory. In order to read attributes from '.gitattributes' files that may be in a sparse directory: When path is in cone mode of sparse checkout: 1.If path is a sparse directory, read the tree OIDs from the sparse directory. 2.If path is a regular files, read the attributes directly from the blob data stored in the cache. Helped-by: Victoria Dye Signed-off-by: Shuqi Liang --- attr.c | 64 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/attr.c b/attr.c index 7d39ac4a29..b0d26da102 100644 --- a/attr.c +++ b/attr.c @@ -808,35 +808,57 @@ static struct attr_stack *read_attr_from_blob(struct index_state *istate, static struct attr_stack *read_attr_from_index(struct index_state *istate, const char *path, unsigned flags) { + struct attr_stack *stack = NULL; + int i; + struct strbuf path1 = STRBUF_INIT; + struct strbuf path2 = STRBUF_INIT; + char *first_slash = NULL; char *buf; unsigned long size; if (!istate) return NULL; - /* - * The .gitattributes file only applies to files within its - * parent directory. In the case of cone-mode sparse-checkout, - * the .gitattributes file is sparse if and only if all paths - * within that directory are also sparse. Thus, don't load the - * .gitattributes file since it will not matter. - * - * In the case of a sparse index, it is critical that we don't go - * looking for a .gitattributes file, as doing so would cause the - * index to expand. - */ - if (!path_in_cone_mode_sparse_checkout(path, istate)) - return NULL; - - buf = read_blob_data_from_index(istate, path, &size); - if (!buf) - return NULL; - if (size >= ATTR_MAX_FILE_SIZE) { - warning(_("ignoring overly large gitattributes blob '%s'"), path); - return NULL; + first_slash = strchr(path, '/'); + if (first_slash) { + strbuf_add(&path1, path, first_slash - path + 1); + strbuf_addstr(&path2, first_slash + 1); } - return read_attr_from_buf(buf, path, flags); + if(!path_in_cone_mode_sparse_checkout(path, istate)){ + for (i = 0; i < istate->cache_nr; i++) { + struct cache_entry *ce = istate->cache[i]; + if ( !strcmp(istate->cache[i]->name, path1.buf)&&S_ISSPARSEDIR(ce->ce_mode)) { + stack = read_attr_from_blob(istate, &ce->oid, path2.buf, flags); + }else if(S_ISREG(ce->ce_mode) && !strcmp(istate->cache[i]->name, path)){ + unsigned long sz; + enum object_type type; + void *data; + + data = repo_read_object_file(the_repository, &istate->cache[i]->oid, + &type, &sz); + if (!data || type != OBJ_BLOB) { + free(data); + strbuf_release(&path1); + strbuf_release(&path2); + return NULL; + } + stack = read_attr_from_buf(data, path, flags); + } + } + }else{ + buf = read_blob_data_from_index(istate, path, &size); + if (!buf) + return NULL; + if (size >= ATTR_MAX_FILE_SIZE) { + warning(_("ignoring overly large gitattributes blob '%s'"), path); + return NULL; + } + stack = read_attr_from_buf(buf, path, flags); + } + strbuf_release(&path1); + strbuf_release(&path2); + return stack; } static struct attr_stack *read_attr(struct index_state *istate, From patchwork Sat Jul 1 06:48:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuqi Liang X-Patchwork-Id: 13298930 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7C54EB64DD for ; Sat, 1 Jul 2023 06:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbjGAGzr (ORCPT ); Sat, 1 Jul 2023 02:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbjGAGzH (ORCPT ); Sat, 1 Jul 2023 02:55:07 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 426D24C1E for ; Fri, 30 Jun 2023 23:49:02 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-401e38e203dso21647871cf.3 for ; Fri, 30 Jun 2023 23:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688194141; x=1690786141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HeQbDBwjm+QHeePsg6tzXgliWFGrMDfId2ndVhXjHgQ=; b=hhFvvRiZ/TSsmogTI8R5JIcLiByBPxSS/j0FOuiITXMTt81RXsL8xGbdJsiB+nljza waLCb9QokdCPnSgR4ErjusNIVNIiCnslhc1DMmv7K8azo9pUPjUTJ0UO7ly19O3fDiNs 8kDuRfwTbxLUuI/o0s3jFN8pG8eX362g1S9pIxVlhsFNi8Je+u9CGD7GdpzVgTH+UFzO dW5AmsRblDEKKJQPE+CIbm6ga9oWUwUSAzZWRm63ouMR/yU+EgjBnA9i4hKmhPb4ki9j kV+R2Asx42po/+tdSU0oULvW9kGkAmpoDDjzEYFFXTQzhUVgiiTAsBEywCrmsNeHBkWF WxKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688194141; x=1690786141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HeQbDBwjm+QHeePsg6tzXgliWFGrMDfId2ndVhXjHgQ=; b=TEMUT0uIjeLwkl6E1IzGaYBIx6BUmm7mmpsDYbRh/nGlPx7HAye0/msCkTQZK2here BZzlo3b9vQJFVKYdyYtlVR3RrAct7jIki2S3vHVTipxXhPddZf3yaX8Vv3GVrgFDjTke VYG3ph0W3pY+AhmdInXQrWOVKDhjlg+Fn7gSdwiae1HD/nqoDT0Mqh1x1C582N2DnyG3 Zux6XMNxGheODWtvj2R5/JGAlD6AH9H/tbU96jWznZbwXrkn+dy54BGdyYD69coDbdQJ FBXfDQIixzqzDQ/h+/SlxEdij0FYzscv9rsjnpHcINpvdlAsK6q1darBFAJ4LNoSQYWg Jjyg== X-Gm-Message-State: AC+VfDzpxkbvqKEI6exrRiybDZ8XVdzACIHk9kracKlz4lX739jg4NlM 3h0W53xnLmtWOiEPxaLno8m8p1w6YICnwA== X-Google-Smtp-Source: ACHHUZ4aGqwIpTpIiE9jpGW7S1F7HsTE4QTQTojoiqTPJIV42ZGZGBH38eNyS9IQHluJRCOifWRp5Q== X-Received: by 2002:a05:622a:ca:b0:3fd:ecdc:1e1e with SMTP id p10-20020a05622a00ca00b003fdecdc1e1emr6702848qtw.22.1688194140869; Fri, 30 Jun 2023 23:49:00 -0700 (PDT) Received: from localhost.localdomain (bras-base-london142cw-grc-18-69-158-189-182.dsl.bell.ca. [69.158.189.182]) by smtp.googlemail.com with ESMTPSA id a26-20020ac8435a000000b003e69c51cf53sm2269720qtn.72.2023.06.30.23.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 23:49:00 -0700 (PDT) From: Shuqi Liang To: git@vger.kernel.org Cc: Shuqi Liang , vdye@github.com, gitster@pobox.com Subject: [PATCH v1 2/3] t1092: add tests for `git check-attr` Date: Sat, 1 Jul 2023 02:48:42 -0400 Message-Id: <20230701064843.147496-3-cheskaqiqi@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230701064843.147496-1-cheskaqiqi@gmail.com> References: <20230701064843.147496-1-cheskaqiqi@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add tests for `git check-attr`, make sure it behaves as expected when path is both inside or outside of sparse-checkout definition. Helped-by: Victoria Dye Signed-off-by: Shuqi Liang --- t/t1092-sparse-checkout-compatibility.sh | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index 8a95adf4b5..4edfa3c168 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -2259,4 +2259,33 @@ test_expect_success 'worktree is not expanded' ' ensure_not_expanded worktree remove .worktrees/hotfix ' +test_expect_success 'check-attr with pathspec inside sparse definition' ' + init_repos && + + echo "a -crlf myAttr" >>.gitattributes && + run_on_all cp ../.gitattributes ./deep && + + test_all_match git check-attr -a -- deep/a && + + test_all_match git add deep/.gitattributes && + test_all_match git check-attr -a --cached -- deep/a +' + +test_expect_success 'check-attr with pathspec outside sparse definition' ' + init_repos && + + echo "a -crlf myAttr" >>.gitattributes && + run_on_sparse mkdir folder1 && + run_on_all cp ../.gitattributes ./folder1 && + run_on_all cp a folder1/a && + + test_all_match git check-attr -a -- folder1/a && + + git -C full-checkout add folder1/.gitattributes && + run_on_sparse git add --sparse folder1/.gitattributes && + run_on_all git commit -m "add .gitattributes" && + test_sparse_match git sparse-checkout reapply && + test_all_match git check-attr -a --cached -- folder1/a +' + test_done From patchwork Sat Jul 1 06:48:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuqi Liang X-Patchwork-Id: 13298931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42308EB64DC for ; Sat, 1 Jul 2023 06:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230451AbjGAGzu (ORCPT ); Sat, 1 Jul 2023 02:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbjGAGzI (ORCPT ); Sat, 1 Jul 2023 02:55:08 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3BFB3C3E for ; Fri, 30 Jun 2023 23:49:04 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-4009ea1597bso21254811cf.1 for ; Fri, 30 Jun 2023 23:49:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688194143; x=1690786143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QPQarEVInifdzSj09d4emw9k7cKTZRLP8g/cnqYEdG0=; b=RJeAJLEkdyUj7HUi6tWXnAcrvAtsloTr8TE4NH2Zxx+XFGlpApqp3Xs1jAI//UUdhR MbEtSqPclnusQKAdn945DPNHHjp4Q34R98mr5wU1PeKuxGUrUBPA/bWVw8XDY3MsBnST 5S0VeWHmZWhRDqT5Og7HPsPJbC4a+PPT34VKD222ObJ7Gnoag9xMXd1ZH/8kyWpolwxr eUF1az1h12C8gK8cM71sFn7K4aWzaWmdFGGH+rERL6LEwu7vgMA+iz/N18kA+8RNXDtY 5u7z/mT6qA+nvc/gVIaFPNHAmxBx3ve95Osv8ratPDit5oyI8HxVvA03UiAO00bfq2PS dsoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688194143; x=1690786143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QPQarEVInifdzSj09d4emw9k7cKTZRLP8g/cnqYEdG0=; b=WO6LSPb+L/WdQSiCYKlHuTLbaClIlOoH65P5DN/tSTB3mdPl5I58SUVwnKw8ptu9he KmZ8L+GvXogUU4vyeNU6BaFksxGDOgfeknapJzohisYaUfVYMmXOdJA1rWcSoYWCXZul U3q7g3Hqp9HUt1x9auLdIBLFbPZRzjseI9ttNNLWSQoEFEOZ3kdxMLHxd9Y5sKzC9Qbv SkK7Z8J1AxdIrFTR+nRGyXGxnZnzuky14u7++iLPjdzDMdTVCmKSvYf6HKh3KkSZhZ6V ocG+GKsCfs/NKqLoPcgMrtEUOv+V9jGkkJgnnhRPjVAfhiHRQp7fsuB0oYeicp+IvevQ 8HQw== X-Gm-Message-State: ABy/qLZPf3aG9nZmA4wjSjcUp8ssqC93fl+J8YjjUOMobDX1kz30Y8y7 3EtYyzE+omJS1xuPy3G79JE+rJ9LbJsuAg== X-Google-Smtp-Source: ACHHUZ4lrRjzNmI3cgOWhCB2rjtOBGizXqFuu8KK6eCVBwaAwmBm9uj1ynjAn/sVyrKaGkECjBmR2g== X-Received: by 2002:ac8:5c82:0:b0:3ff:25d0:d29e with SMTP id r2-20020ac85c82000000b003ff25d0d29emr6169854qta.62.1688194143307; Fri, 30 Jun 2023 23:49:03 -0700 (PDT) Received: from localhost.localdomain (bras-base-london142cw-grc-18-69-158-189-182.dsl.bell.ca. [69.158.189.182]) by smtp.googlemail.com with ESMTPSA id a26-20020ac8435a000000b003e69c51cf53sm2269720qtn.72.2023.06.30.23.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 23:49:02 -0700 (PDT) From: Shuqi Liang To: git@vger.kernel.org Cc: Shuqi Liang , vdye@github.com, gitster@pobox.com Subject: [PATCH v1 3/3] check-attr: integrate with sparse-index Date: Sat, 1 Jul 2023 02:48:43 -0400 Message-Id: <20230701064843.147496-4-cheskaqiqi@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230701064843.147496-1-cheskaqiqi@gmail.com> References: <20230701064843.147496-1-cheskaqiqi@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Set the requires-full-index to false for "diff-tree". Add test to ensure the index is not expanded when the sparse index is enabled. The `p2000` tests demonstrate a ~63% execution time reduction for 'git check-attr' using a sparse index. Test before after ----------------------------------------------------------------------- 2000.106: git check-attr -a f2/f4/a (full-v3) 0.05 0.05 +0.0% 2000.107: git check-attr -a f2/f4/a (full-v4) 0.05 0.05 +0.0% 2000.108: git check-attr -a f2/f4/a (sparse-v3) 0.04 0.02 -50.0% 2000.109: git check-attr -a f2/f4/a (sparse-v4) 0.04 0.01 -75.0% Helped-by: Victoria Dye Signed-off-by: Shuqi Liang --- builtin/check-attr.c | 3 +++ t/t1092-sparse-checkout-compatibility.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/builtin/check-attr.c b/builtin/check-attr.c index b22ff748c3..02267f9bc1 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -122,6 +122,9 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, check_attr_options, check_attr_usage, PARSE_OPT_KEEP_DASHDASH); + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + if (repo_read_index(the_repository) < 0) { die("invalid cache"); } diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index 4edfa3c168..317ccc8ec5 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -2288,4 +2288,15 @@ test_expect_success 'check-attr with pathspec outside sparse definition' ' test_all_match git check-attr -a --cached -- folder1/a ' +test_expect_success 'sparse-index is not expanded: check-attr' ' + init_repos && + + echo "a -crlf myAttr" >>.gitattributes && + run_on_all cp ../.gitattributes ./deep && + + ensure_not_expanded check-attr -a -- deep/a && + run_on_all git add deep/.gitattributes && + ensure_not_expanded check-attr -a --cached -- deep/a +' + test_done