]> oss.titaniummirror.com Git - repo_shell.git/commitdiff
Add check option to repo_shell
authorR. Steve McKown <rsmckown@gmail.com>
Fri, 28 Sep 2012 18:37:05 +0000 (12:37 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Fri, 28 Sep 2012 19:15:57 +0000 (13:15 -0600)
repo_shell.c

index bb61824b64f8c312349ad0c76695d05cf3368f83..4a6dd2b0e8c257a284f52c8162092d55a1f104ad 100644 (file)
@@ -213,6 +213,16 @@ int main(int argc, char **argv)
     return 0;
   }
 
+  if ((!strcmp(argv[1], "-c") || !strcmp(argv[1], "--check"))) {
+    perms_t p;
+
+    if (argc !=4)
+      die("usage: %s -c|--check <user> <repo>", argv[0]);
+    p = git_acl(argv[2], argv[3], cfg.git_acl_file);
+    printf("%s\n", git_acl_perms_as_str(p));
+    return 0;
+  }
+
   if (argc == 3) {
     /* argv[0] = repo_shell, argv[1] = -c, argv[2] = cmd
      * cmd = "svnserve -t" or "git-xxx '/path/to/repo.git'"