Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
changeNames.forEach(function (root) {
var meta = pendingChanges[root].meta;
var path = join(root, ".gitmodules");
var encoded = codec.encode(meta);
if (!encoded.trim()) {
// Delete the file if it's now empty
writes[path] = {};
}
else {
writes[path] = {
mode: modes.file,
content: encoded
};
}
});
pendingChanges = {};
function join() {
if (!meta || !childHead) return;
if (!meta.submodule) meta.submodule = {};
meta.submodule[localPath] = {
path: localPath,
url: url
};
callback(null, [
{ path: ".gitmodules",
mode: modes.blob,
content: encodeConfig(meta)
},
{ path: localPath,
mode: modes.commit,
hash: childHead
}
]);
}
}