Don't allow commit_delta to access commit message
Change-Id: I393efae8ecb51f442a7f2be7bf37edcfd619fb4e
This commit is contained in:
@@ -101,12 +101,16 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
|||||||
Pattern regex = (Pattern)((JavaObjectTerm)a1).object();
|
Pattern regex = (Pattern)((JavaObjectTerm)a1).object();
|
||||||
Iterator<PatchListEntry> iter =
|
Iterator<PatchListEntry> iter =
|
||||||
(Iterator<PatchListEntry>)((JavaObjectTerm)a5).object();
|
(Iterator<PatchListEntry>)((JavaObjectTerm)a5).object();
|
||||||
if (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
PatchListEntry patch = iter.next();
|
PatchListEntry patch = iter.next();
|
||||||
String newName = patch.getNewName();
|
String newName = patch.getNewName();
|
||||||
String oldName = patch.getOldName();
|
String oldName = patch.getOldName();
|
||||||
Patch.ChangeType changeType = patch.getChangeType();
|
Patch.ChangeType changeType = patch.getChangeType();
|
||||||
|
|
||||||
|
if (newName.equals("/COMMIT_MSG")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (regex.matcher(newName).matches() ||
|
if (regex.matcher(newName).matches() ||
|
||||||
(oldName != null && regex.matcher(oldName).matches())) {
|
(oldName != null && regex.matcher(oldName).matches())) {
|
||||||
SymbolTerm changeSym = getTypeSymbol(changeType);
|
SymbolTerm changeSym = getTypeSymbol(changeType);
|
||||||
@@ -117,13 +121,13 @@ public class PRED_commit_delta_4 extends Predicate.P4 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!a2.unify(changeSym, engine.trail)) {
|
if (!a2.unify(changeSym, engine.trail)) {
|
||||||
return engine.fail();
|
continue;
|
||||||
}
|
}
|
||||||
if (!a3.unify(newSym, engine.trail)) {
|
if (!a3.unify(newSym, engine.trail)) {
|
||||||
return engine.fail();
|
continue;
|
||||||
}
|
}
|
||||||
if (!a4.unify(oldSym, engine.trail)) {
|
if (!a4.unify(oldSym, engine.trail)) {
|
||||||
return engine.fail();
|
continue;
|
||||||
}
|
}
|
||||||
return engine.cont;
|
return engine.cont;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user