Skip to content

Commit

Permalink
Refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
ferretwithaberet committed Apr 9, 2020
1 parent 15d7bbe commit 17780c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/vizion.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ vizion.revertTo = function(argv, cb) {
var revision = (argv.revision) ? argv.revision : false;
var _folder = (argv.folder != undefined) ? argv.folder : '.';

if (revision && !/^[A-Za-z0-9]+$/.test(revision))
return cb('Error vizion::revertTo() received an invalid revision: ' + revision);

if (!revision)
if (!revision) {
return cb({msg: 'Cannot revert to an invalid commit revision', path: _folder});
} else if (!/^[A-Fa-f0-9]+$/.test(revision)) {
return cb({msg: 'Cannot revert to an invalid commit revision', path: _folder});
}

identify(_folder, function(type, folder) {
if (ALL[type])
Expand Down

0 comments on commit 17780c0

Please sign in to comment.