return leaf;
}
- void storedSymbolicRef(RefDirectoryUpdate u, long modified, String target) {
- putLooseRef(newSymbolicRef(modified, u.getRef().getName(), target));
+ void storedSymbolicRef(RefDirectoryUpdate u, FileSnapshot snapshot,
+ String target) {
+ putLooseRef(newSymbolicRef(snapshot, u.getRef().getName(), target));
fireRefsChanged();
}
return new RefDirectoryRename(from, to);
}
- void stored(RefDirectoryUpdate update, long modified) {
+ void stored(RefDirectoryUpdate update, FileSnapshot snapshot) {
final ObjectId target = update.getNewObjectId().copy();
final Ref leaf = update.getRef().getLeaf();
- putLooseRef(new LooseUnpeeled(modified, leaf.getName(), target));
+ putLooseRef(new LooseUnpeeled(snapshot, leaf.getName(), target));
}
private void putLooseRef(LooseRef ref) {
if (!currentSnapshot.isModified(path))
return ref;
name = ref.getName();
- } else if (!path.exists())
- return null;
+ }
final int limit = 4096;
final byte[] buf;
currentSnapshot.setClean(otherSnapshot);
return ref;
}
- return newSymbolicRef(path.lastModified(), name, target);
+ return newSymbolicRef(otherSnapshot, name, target);
}
if (n < OBJECT_ID_STRING_LENGTH)
String content = RawParseUtils.decode(buf, 0, n);
throw new IOException(MessageFormat.format(JGitText.get().notARef, name, content));
}
- return new LooseUnpeeled(path.lastModified(), name, id);
+ return new LooseUnpeeled(otherSnapshot, name, id);
}
private static boolean isSymRef(final byte[] buf, int n) {
}
}
- private static LooseSymbolicRef newSymbolicRef(long lastModified,
+ private static LooseSymbolicRef newSymbolicRef(FileSnapshot snapshot,
String name, String target) {
Ref dst = new ObjectIdRef.Unpeeled(NEW, target, null);
- return new LooseSymbolicRef(lastModified, name, dst);
+ return new LooseSymbolicRef(snapshot, name, dst);
}
private static interface LooseRef extends Ref {
implements LooseRef {
private final FileSnapshot snapShot;
- LoosePeeledTag(long mtime, String refName, ObjectId id, ObjectId p) {
+ LoosePeeledTag(FileSnapshot snapshot, String refName, ObjectId id,
+ ObjectId p) {
super(LOOSE, refName, id, p);
- snapShot = FileSnapshot.save(mtime);
+ this.snapShot = snapshot;
}
public FileSnapshot getSnapShot() {
implements LooseRef {
private final FileSnapshot snapShot;
- LooseNonTag(long mtime, String refName, ObjectId id) {
+ LooseNonTag(FileSnapshot snapshot, String refName, ObjectId id) {
super(LOOSE, refName, id);
- snapShot = FileSnapshot.save(mtime);
+ this.snapShot = snapshot;
}
public FileSnapshot getSnapShot() {
private final static class LooseUnpeeled extends ObjectIdRef.Unpeeled
implements LooseRef {
- private final FileSnapshot snapShot;
+ private FileSnapshot snapShot;
- LooseUnpeeled(long mtime, String refName, ObjectId id) {
+ LooseUnpeeled(FileSnapshot snapShot, String refName, ObjectId id) {
super(LOOSE, refName, id);
- snapShot = FileSnapshot.save(mtime);
+ this.snapShot = snapShot;
}
public FileSnapshot getSnapShot() {
public LooseRef peel(ObjectIdRef newLeaf) {
if (newLeaf.getPeeledObjectId() != null)
- return new LoosePeeledTag(snapShot.lastModified(), getName(),
+ return new LoosePeeledTag(snapShot, getName(),
getObjectId(), newLeaf.getPeeledObjectId());
else
- return new LooseNonTag(snapShot.lastModified(), getName(),
+ return new LooseNonTag(snapShot, getName(),
getObjectId());
}
}
LooseRef {
private final FileSnapshot snapShot;
- LooseSymbolicRef(long mtime, String refName, Ref target) {
+ LooseSymbolicRef(FileSnapshot snapshot, String refName, Ref target) {
super(refName, target);
- snapShot = FileSnapshot.save(mtime);
+ this.snapShot = snapshot;
}
public FileSnapshot getSnapShot() {