Re: [PATCH 1/1] attr: add builtin objectmode values support
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 16, 2023, 07:57 UTC
- Message-ID
- <xmqqmsveqgex.fsf@gitster.g>
- In-Reply-To
- <20231116054437.2343549-1-jojwang@google.com>
Joanna Wang <jojwang@google.com> writes:
Show 16 quoted lines
> diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh > index a9c1e4e0ec..b08a32ea68 100755 > --- a/t/t6135-pathspec-with-attrs.sh > +++ b/t/t6135-pathspec-with-attrs.sh > @@ -295,4 +295,29 @@ test_expect_success 'reading from .gitattributes in a subdirectory (3)' ' > test_cmp expect actual > ' > > +test_expect_success 'pathspec with builtin_objectmode attr can be used' ' > + >mode_exec_file_1 && > + > + git status -s ":(attr:builtin_objectmode=100644)mode_exec_*" >actual && > + echo ?? mode_exec_file_1 >expect && > + test_cmp expect actual && > + > + git add mode_exec_file_1 && chmod +x mode_exec_file_1 &&
This again would break with filesystems that are incapable of supporting executable bit natively. Writing one command per line, doing something like this may help
git add mode_exec_file_1 && git update-index --chmod=+x mode_exec_file_1 &&
Show 8 quoted lines
> + git status -s ":(attr:builtin_objectmode=100755)mode_exec_*" >actual && > + echo AM mode_exec_file_1 >expect && > + test_cmp expect actual > +' > + > +test_expect_success 'builtin_objectmode attr can be excluded' ' > + >mode_1_regular && > + >mode_1_exec && chmod +x mode_1_exec &&
Ditto.
Show 10 quoted lines
> + git status -s ":(exclude,attr:builtin_objectmode=100644)" "mode_1_*" >actual && > + echo ?? mode_1_exec >expect && > + test_cmp expect actual && > + > + git status -s ":(exclude,attr:builtin_objectmode=100755)" "mode_1_*" >actual && > + echo ?? mode_1_regular >expect && > + test_cmp expect actual > +' > + > test_done