1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.internal.storage.file;
12
13 import java.io.File;
14 import java.io.IOException;
15
16 import org.eclipse.jgit.attributes.AttributesNode;
17 import org.eclipse.jgit.lib.Constants;
18 import org.eclipse.jgit.lib.Repository;
19 import org.eclipse.jgit.util.FS;
20
21
22
23
24 public class InfoAttributesNode extends AttributesNode {
25 final Repository repository;
26
27
28
29
30
31
32
33 public InfoAttributesNode(Repository repository) {
34 this.repository = repository;
35 }
36
37
38
39
40
41
42
43 public AttributesNode load() throws IOException {
44 AttributesNode r = new AttributesNode();
45
46 FS fs = repository.getFS();
47
48 File attributes = fs.resolve(repository.getDirectory(),
49 Constants.INFO_ATTRIBUTES);
50 FileRepository.AttributesNodeProviderImpl.loadRulesFromFile(r, attributes);
51
52 return r.getRules().isEmpty() ? null : r;
53 }
54
55 }