Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
readEntry(path, function (err, entry) {
if (err) return callback(err);
if (!entry.hash) return callback(err || new Error("Missing entry"));
if (!modes.isFile(entry.mode)) return callback("Not a file");
var repo = repos[entry.root];
repo.loadAs("blob", entry.hash, function (err, blob) {
if (!blob) return callback(err || new Error("Problem loading blob"));
entry.blob = blob;
callback(null, entry);
});
});
}
makeUnique(row, name, mode, function (path) {
if (modes.isFile(mode)) {
activePath = path;
}
openPaths[row.path] = true;
row.call(path, fs.writeEntry, {
mode: mode,
hash: hash
});
});
}
row.call(fs.prepEntry, newPath, function () {
if (modes.isFile(row.mode)) activePath = path;
row.call(copy, path);
row.call(fs.copyEntry, path);
});
});
var config = fs.configs[row.path];
var repo = fs.findRepo(row.path);
if (repo.fetch && config.current === config.head) {
actions.push(
{sep:true},
{icon:"cw", label:"Sync with Remote", action: sync }
);
if (config.ahead && config.behind) {
actions.push(
{icon:"upload-cloud", label:"Force push", action: forcePush },
{icon:"trash", label:"Discard Local Commits", action: discardCommits }
);
}
}
}
else if (modes.isFile(row.mode)) {
var label = (row.mode === modes.exec) ?
"Make not Executable" :
"Make Executable";
actions.push(
{sep:true},
{icon:"asterisk", label: label, action: toggleExec}
);
}
if (row.path) actions.push(
{sep:true},
{icon:"pencil", label:"Move " + type, action: moveEntry},
{icon:"docs", label:"Copy " + type, action: copyEntry},
{icon:"trash", label:"Delete " + type, action: removeEntry}
);
if (runtimes.length) {
actions.push({sep:true});