From 57b1e6b4999ab1ac5f1be830ddc704efca81b2a4 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 12 May 2014 10:16:22 +0800 Subject: [PATCH] GitRepo.vala --- GitRepo.vala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/GitRepo.vala b/GitRepo.vala index 2e7c9e33..d7333d80 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -32,6 +32,32 @@ public class GitRepo : Object return -1; } + + public static Array list_cache = null; + + public static Array list() + { + + if (Repo._list !== false) { + return Repo._list; + } + Repo._list = []; + var dir = GLib.get_home_dir() + '/gitlive'; + var ar = File.list(dir ); + print(JSON.stringify(ar)); + ar.forEach(function(f) { + if (File.exists(dir + '/' + f +'/.git')) { + Repo._list.push(new imports.Scm.Git.Repo.Repo( { + repopath : dir +'/' + f, + name : f + })) + } + }); + + return Repo._list; + +} + /** -- 2.39.2