From 155c6f7d6a924598a446df38ac53ab9038e1188a Mon Sep 17 00:00:00 2001 From: Luke Plaster Date: Fri, 2 Sep 2016 12:02:44 +0800 Subject: [PATCH] src/repo: fixed single argument form of ls_files --- src/repo.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/repo.coffee b/src/repo.coffee index 89906a2..d5b76f6 100644 --- a/src/repo.coffee +++ b/src/repo.coffee @@ -293,8 +293,12 @@ module.exports = class Repo # callback - Receives `(err,stdout)`. # ls_files: (files, options, callback) -> + # support the single arg sig + if arguments.length == 1 + callback = files + files = null # support the old (options, callback) sig - if arguments.length < 3 + else if arguments.length < 3 [options, callback] = [files, options] files = null callback ?= ->