1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.internal.storage.dfs;
12
13 import org.eclipse.jgit.internal.storage.pack.ObjectToPack;
14 import org.eclipse.jgit.internal.storage.pack.StoredObjectRepresentation;
15 import org.eclipse.jgit.lib.AnyObjectId;
16
17
18 class DfsObjectToPack extends ObjectToPack {
19 private static final int FLAG_FOUND = 1 << 0;
20
21
22 DfsPackFile pack;
23
24
25 long offset;
26
27
28 long length;
29
30 DfsObjectToPack(AnyObjectId src, int type) {
31 super(src, type);
32 }
33
34 final boolean isFound() {
35 return isExtendedFlag(FLAG_FOUND);
36 }
37
38 final void setFound() {
39 setExtendedFlag(FLAG_FOUND);
40 }
41
42
43 @Override
44 protected void clearReuseAsIs() {
45 super.clearReuseAsIs();
46 pack = null;
47 }
48
49
50 @Override
51 public void select(StoredObjectRepresentation ref) {
52 DfsObjectRepresentation ptr = (DfsObjectRepresentation) ref;
53 this.pack = ptr.pack;
54 this.offset = ptr.offset;
55 this.length = ptr.length;
56 }
57 }