Skip to content

Commit ea462ba

Browse files
committed
work on @bkendall feedback
1 parent cdee3dc commit ea462ba

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/routes/actions/github.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,24 +226,22 @@ function followBranch (instancesKey) {
226226
var newContextVersionId = req.jsonNewBuild.contextVersions[0];
227227
var newBuildId = req.jsonNewBuild._id;
228228
var oldContextVersion = find(req.newContextVersionIds, function (val) {
229-
return val === newContextVersionId;
229+
return val === newContextVersionId;
230230
});
231-
if (!oldContextVersion) {
232-
req.newContextVersionIds.push(newContextVersionId);
233-
}
234-
req.instanceIds.push(req.instance._id.toString());
235231
var infoObject = {
236232
instance: req.instance,
237233
buildId: newBuildId,
238234
targetUrl: req.targetUrl,
239235
instanceCreator: req.instanceCreator
240236
};
241-
if (req.contextVersionNewInfo[newContextVersionId]) {
242-
req.contextVersionNewInfo[newContextVersionId].push(infoObject);
237+
if (!oldContextVersion) {
238+
req.newContextVersionIds.push(newContextVersionId);
239+
req.contextVersionNewInfo[newContextVersionId] = [infoObject];
243240
}
244241
else {
245-
req.contextVersionNewInfo[newContextVersionId] = [infoObject];
242+
req.contextVersionNewInfo[newContextVersionId].push(infoObject);
246243
}
244+
req.instanceIds.push(req.instance._id.toString());
247245
}
248246
next();
249247
}

0 commit comments

Comments
 (0)