File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1223,13 +1223,6 @@ static void compute_default_attr_source(struct object_id *attr_source)
12231223 ignore_bad_attr_tree = 1 ;
12241224 }
12251225
1226- if (!default_attr_source_tree_object_name &&
1227- startup_info -> have_repository &&
1228- is_bare_repository ()) {
1229- default_attr_source_tree_object_name = "HEAD" ;
1230- ignore_bad_attr_tree = 1 ;
1231- }
1232-
12331226 if (!default_attr_source_tree_object_name || !is_null_oid (attr_source ))
12341227 return ;
12351228
Original file line number Diff line number Diff line change @@ -398,13 +398,19 @@ test_expect_success 'bad attr source defaults to reading .gitattributes file' '
398398 )
399399'
400400
401- test_expect_success ' bare repo defaults to reading .gitattributes from HEAD' '
401+ test_expect_success ' bare repo no longer defaults to reading .gitattributes from HEAD' '
402402 test_when_finished rm -rf test bare_with_gitattribute &&
403403 git init test &&
404404 test_commit -C test gitattributes .gitattributes "f/path test=val" &&
405405 git clone --bare test bare_with_gitattribute &&
406- echo "f/path: test: val" >expect &&
406+
407+ echo "f/path: test: unspecified" >expect &&
407408 git -C bare_with_gitattribute check-attr test -- f/path >actual &&
409+ test_cmp expect actual &&
410+
411+ echo "f/path: test: val" >expect &&
412+ git -C bare_with_gitattribute -c attr.tree=HEAD \
413+ check-attr test -- f/path >actual &&
408414 test_cmp expect actual
409415'
410416
Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ test_expect_success 'git archive vs. bare' '
133133'
134134
135135test_expect_success ' git archive with worktree attributes, bare' '
136- (cd bare && git archive --worktree-attributes HEAD) >bare-worktree.tar &&
136+ (cd bare &&
137+ git -c attr.tree=HEAD archive --worktree-attributes HEAD) >bare-worktree.tar &&
137138 (mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar
138139'
139140
You can’t perform that action at this time.
0 commit comments