Skip to content
Snippets Groups Projects
Unverified Commit 6d52c15c authored by Daniel's avatar Daniel
Browse files

FIX: Reference correct version.

If not-to-be-changed entities are in container.
parent d5d9a714
No related branches found
No related tags found
No related merge requests found
......@@ -188,17 +188,19 @@ public abstract class Job extends AbstractObservable implements Observer {
if (ret != null) {
return ret;
}
} else if (version.startsWith("HEAD~") && getEntityById(id) != null) {
// if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is
// part of this request (i.e. is to be updated), the actual offset has to be
// reduced by 1. HEAD always denotes the entity@HEAD *after* the successful
// transaction.
int offset = Integer.parseInt(version.substring(5)) - 1;
if (offset == 0) {
// special case HEAD~1
resulting_version = "HEAD";
} else {
resulting_version = new StringBuilder().append("HEAD~").append(offset).toString();
} else if (version.startsWith("HEAD~")) {
EntityInterface entById = getEntityById(id);
if (entById != null && entById.getEntityStatus() != EntityStatus.VALID) {
// if version is HEAD~{OFFSET} with {OFFSET} > 0 and the targeted entity is is to be
// updated, the actual offset has to be reduced by 1. HEAD always denotes the entity@HEAD
// *after* the successful transaction, so that it is consistent with subsequent retrieves.
int offset = Integer.parseInt(version.substring(5)) - 1;
if (offset == 0) {
// special case HEAD~1
resulting_version = "HEAD";
} else {
resulting_version = new StringBuilder().append("HEAD~").append(offset).toString();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment