Behaves more like other functions, reduce potential for bugs in error
path
Signed-off-by: Tobias Ulmer <tu@emlix.com>
function cvs.working_copy_available(info, sourcename)
local src = source.sources[sourcename]
local dir = e2lib.join(info.root, src:get_working())
- return e2lib.isdir(dir)
+ if not e2lib.isdir(dir) then
+ return false, err.new("working copy for %s is not available", sourcename)
+ end
+ return true
end
function cvs.has_working_copy(info, sourcename)
end
function files.working_copy_available(info, sourcename)
- return false
+ return false, err.new("source %s doesn't require a working copy", sourcename)
end
function files.has_working_copy(info, sourcename)
local src = source.sources[sourcename]
local dir = e2lib.join(info.root, src:get_working())
- return e2lib.isdir(dir)
+ if not e2lib.isdir(dir) then
+ return false, err.new("working copy for %s is not available", sourcename)
+ end
+ return true
end
function svn.check_workingcopy(info, sourcename)