Hello community,

here is the log from the commit of package cgit for openSUSE:Factory checked in 
at 2011-12-07 14:37:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cgit (Old)
 and      /work/SRC/openSUSE:Factory/.cgit.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cgit", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:Factory/cgit/cgit.changes        2011-11-25 
10:12:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.cgit.new/cgit.changes   2011-12-07 
14:37:32.000000000 +0100
@@ -1,0 +2,12 @@
+Mon Nov 28 14:04:00 CET 2011 - [email protected]
+
+- Add patch cgit-fix-more-read_tree_recursive-invocations.diff:
+
+    There are more incorrect invocations of read_tree_recursive(), 
+    one example can be seen when visiting one of the 'plain' links 
+    in the tree view (contents of the wrong file are shown).
+    
+    This time I did what I should have done last time and checked 
+    and adjusted all invocations of read_tree_recursive().
+
+-------------------------------------------------------------------

New:
----
  cgit-fix-more-read_tree_recursive-invocations.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cgit.spec ++++++
--- /var/tmp/diff_new_pack.4Ci6tB/_old  2011-12-07 14:37:34.000000000 +0100
+++ /var/tmp/diff_new_pack.4Ci6tB/_new  2011-12-07 14:37:34.000000000 +0100
@@ -34,6 +34,7 @@
 Patch1:         cgit-git-1.7.6_build_fix.patch
 Patch2:         cgit-CVE-2011-2711-fix.diff
 Patch3: cgit-fix-print-tree.diff
+Patch4: cgit-fix-more-read_tree_recursive-invocations.diff
 # Requirements for cgit
 BuildRequires:  gnu-crypto libopenssl-devel libzip-devel
 # Requirements for cgitrc man page generation
@@ -55,6 +56,7 @@
 %patch1 -p1
 %patch2 -p1
 %patch3
+%patch4
 rm -rf git
 mv git-%{git_version} git
 

++++++ cgit-fix-more-read_tree_recursive-invocations.diff ++++++
--- ui-blob.c
+++ ui-blob.c
@@ -37,11 +37,14 @@ int cgit_print_file(char *path, const char *head)
                return -1;
        type = sha1_object_info(sha1, &size);
        if(type == OBJ_COMMIT && path) {
+               struct pathspec pathspec;
                commit = lookup_commit_reference(sha1);
                match_path = path;
                matched_sha1 = sha1;
                found_path = 0;
-               read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, 
NULL);
+               init_pathspec(&pathspec, paths);
+               read_tree_recursive(commit->tree, "", 0, 0, &pathspec, 
walk_tree, NULL);
+               free_pathspec(&pathspec);
                if (!found_path)
                        return -1;
                type = sha1_object_info(sha1, &size);
@@ -80,10 +83,13 @@ void cgit_print_blob(const char *hex, char *path, const 
char *head)
        type = sha1_object_info(sha1, &size);
 
        if((!hex) && type == OBJ_COMMIT && path) {
+               struct pathspec pathspec;
                commit = lookup_commit_reference(sha1);
                match_path = path;
                matched_sha1 = sha1;
-               read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, 
NULL);
+               init_pathspec(&pathspec, paths);
+               read_tree_recursive(commit->tree, "", 0, 0, &pathspec, 
walk_tree, NULL);
+               free_pathspec(&pathspec);
                type = sha1_object_info(sha1,&size);
        }
 
--- ui-plain.c
+++ ui-plain.c
@@ -145,6 +145,7 @@ void cgit_print_plain(struct cgit_context *ctx)
        unsigned char sha1[20];
        struct commit *commit;
        const char *paths[] = {ctx->qry.path, NULL};
+       struct pathspec pathspec;
 
        if (!rev)
                rev = ctx->qry.head;
@@ -165,7 +166,9 @@ void cgit_print_plain(struct cgit_context *ctx)
        }
        else
                match_baselen = basedir_len(paths[0]);
-       read_tree_recursive(commit->tree, "", 0, 0, paths, walk_tree, NULL);
+       init_pathspec(&pathspec, paths);
+       read_tree_recursive(commit->tree, "", 0, 0, &pathspec, walk_tree, NULL);
+       free_pathspec(&pathspec);
        if (!match)
                html_status(404, "Not found", 0);
        else if (match == 2)
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to