Make rev param mandatory for fileops

Specify '*' as rev for don't care.
This commit is contained in:
Girish Ramakrishnan
2013-09-15 19:03:59 -07:00
parent 20aaf3eb01
commit 87f04cd978
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -14,6 +14,8 @@ function remove(req, res, next) {
var repo = req.volume.repo;
var rev = req.body.rev;
if (!rev) return next(new HttpError(400, 'No revision specified'));
repo.fileEntry(filePath, 'HEAD', function (err, fileEntry) {
if (err) {
if (err.code === 'ENOENT') return next(new HttpError(400, 'No such file'));
@@ -39,6 +41,7 @@ function move(req, res, next) {
if (!fromPath) return next(400, 'from_path not specified');
if (!toPath) return next(400, 'to_path not specified');
if (!rev) return next(new HttpError(400, 'No revision specified'));
repo.fileEntry(fromPath, 'HEAD', function (err, fileEntry) {
if (err) {
@@ -65,6 +68,7 @@ function copy(req, res, next) {
if (!fromPath) return next(400, 'from_path not specified');
if (!toPath) return next(400, 'to_path not specified');
if (!rev) return next(new HttpError(400, 'No revision specified'));
repo.fileEntry(fromPath, 'HEAD', function (err, fileEntry) {
if (err) {
+1 -1
View File
@@ -464,7 +464,7 @@ describe('Server API', function () {
.auth(USERNAME, PASSWORD)
.send({ path: 'README.md' })
.end(function (err, res) {
expect(res.statusCode).to.equal(409);
expect(res.statusCode).to.equal(400);
done(err);
});
});