1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.notes;
12
13 import org.eclipse.jgit.lib.AnyObjectId;
14 import org.eclipse.jgit.lib.FileMode;
15 import org.eclipse.jgit.lib.ObjectId;
16 import org.eclipse.jgit.lib.TreeFormatter;
17 import org.eclipse.jgit.util.Paths;
18
19
20 class NonNoteEntry extends ObjectId {
21
22 private final byte[] name;
23
24
25 private final FileMode mode;
26
27
28 NonNoteEntry next;
29
30 NonNoteEntry(byte[] name, FileMode mode, AnyObjectId id) {
31 super(id);
32 this.name = name;
33 this.mode = mode;
34 }
35
36 void format(TreeFormatter fmt) {
37 fmt.append(name, mode, this);
38 }
39
40 int treeEntrySize() {
41 return TreeFormatter.entrySize(mode, name.length);
42 }
43
44 int pathCompare(byte[] bBuf, int bPos, int bLen, FileMode bMode) {
45 return Paths.compare(
46 name, 0, name.length, mode.getBits(),
47 bBuf, bPos, bLen, bMode.getBits());
48 }
49 }