]> gitweb.ps.run Git - ps-cgit/blobdiff - shared.c
Do not include current path in the "tree" menu link
[ps-cgit] / shared.c
index b6d2fa1efe6a47f93054d6a6af29c3b4a5dbbb03..ab00bc93c36fec302ef9de8f00ac976dcd14298d 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -26,6 +26,7 @@ char *cgit_repo_group   = NULL;
 
 int cgit_nocache               =  0;
 int cgit_snapshots             =  0;
+int cgit_enable_index_links    =  0;
 int cgit_enable_log_filecount  =  0;
 int cgit_enable_log_linecount  =  0;
 int cgit_max_lock_attempts     =  5;
@@ -59,7 +60,8 @@ int htmlfd = 0;
 
 int cgit_get_cmd_index(const char *cmd)
 {
-       static char *cmds[] = {"log", "commit", "diff", "tree", "view", "blob", "snapshot", NULL};
+       static char *cmds[] = {"log", "commit", "diff", "tree", "blob",
+                              "snapshot", NULL};
        int i;
 
        for(i = 0; cmds[i]; i++)
@@ -145,6 +147,8 @@ void cgit_global_config_cb(const char *name, const char *value)
                cgit_nocache = atoi(value);
        else if (!strcmp(name, "snapshots"))
                cgit_snapshots = atoi(value);
+       else if (!strcmp(name, "enable-index-links"))
+               cgit_enable_index_links = atoi(value);
        else if (!strcmp(name, "enable-log-filecount"))
                cgit_enable_log_filecount = atoi(value);
        else if (!strcmp(name, "enable-log-linecount"))
@@ -359,7 +363,7 @@ void cgit_diff_tree(const unsigned char *old_sha1,
        opt.format_callback_data = fn;
        diff_setup_done(&opt);
 
-       if (old_sha1)
+       if (old_sha1 && !is_null_sha1(old_sha1))
                ret = diff_tree_sha1(old_sha1, new_sha1, "", &opt);
        else
                ret = diff_root_tree_sha1(new_sha1, "", &opt);