File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed 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)
1223
1223
ignore_bad_attr_tree = 1 ;
1224
1224
}
1225
1225
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
-
1233
1226
if (!default_attr_source_tree_object_name || !is_null_oid (attr_source ))
1234
1227
return ;
1235
1228
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' '
398
398
)
399
399
'
400
400
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' '
402
402
test_when_finished rm -rf test bare_with_gitattribute &&
403
403
git init test &&
404
404
test_commit -C test gitattributes .gitattributes "f/path test=val" &&
405
405
git clone --bare test bare_with_gitattribute &&
406
- echo "f/path: test: val" >expect &&
406
+
407
+ echo "f/path: test: unspecified" >expect &&
407
408
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 &&
408
414
test_cmp expect actual
409
415
'
410
416
Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ test_expect_success 'git archive vs. bare' '
133
133
'
134
134
135
135
test_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 &&
137
138
(mkdir bare-worktree && cd bare-worktree && "$TAR" xf -) <bare-worktree.tar
138
139
'
139
140
You can’t perform that action at this time.
0 commit comments