diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | lib/gitano/util.lua | 8 | ||||
-rw-r--r-- | plugins/rsync.lua | 5 |
3 files changed, 20 insertions, 3 deletions
@@ -155,9 +155,17 @@ install-plugins: install -m 644 plugins/$$PLUGIN $(DESTDIR)$(INST_ROOT)/lib/gitano/plugins; \ done +YARN_ARGS := +ifneq ($(LUA_PATH),) +YARN_ARGS += --env LUA_PATH="$(LUA_PATH)" +endif +ifneq ($(LUA_CPATH),) +YARN_ARGS += --env LUA_CPATH="$(LUA_CPATH)" +endif + test: local $(TEST_BINS) @$(YARN) --env GTT="$$(pwd)/testing/gitano-test-tool" \ - --env LUA_PATH="$(LUA_PATH)" --env LUA_CPATH="$(LUA_CPATH)" \ + $(YARN_ARGS) \ testing/library.yarn $(TESTS) testing/%: testing/%.in $(GEN_BIN) diff --git a/lib/gitano/util.lua b/lib/gitano/util.lua index c2a53a7..291c68d 100644 --- a/lib/gitano/util.lua +++ b/lib/gitano/util.lua @@ -337,12 +337,18 @@ end local tagname_pattern = "^[a-z0-9_%-/]*[a-z0-9_%-]*$" +local cached_expansions = {} + local function prep_expansion(str) -- Parse 'str' and return a table representing a sequence of -- operations required to evaluate the expansion of the string. -- in the simple case, it's merely the string in a table -- if the entry in ret is a string, it's copied. If it's a table -- then that table's [1] is a string which is a tag name to expand. + if cached_expansions[str] then + return cached_expansions[str] + end + local ret = {} local acc = "" local c @@ -386,6 +392,8 @@ local function prep_expansion(str) ret[#ret+1] = acc end + cached_expansions[str] = ret + return ret end diff --git a/plugins/rsync.lua b/plugins/rsync.lua index 310fe59..8f8c8da 100644 --- a/plugins/rsync.lua +++ b/plugins/rsync.lua @@ -39,9 +39,10 @@ local function rsync_detect_repo(config, cmdline) -- Basically, while there's still something to the repopath -- and we've not yet found a repo, strip an element and try again... - while not repo and repopath ~= ""do + while (not repo or repo.is_nascent) and repopath ~= ""do + gitano.log.error("Trying " .. repopath) repo, msg = gitano.repository.find(config, repopath) - if not repo then + if not repo or repo.is_nascent then repopath = repopath:match("^(.*)/[^/]*$") or "" end end |