From 061574b9dd04bbe8fe3a035c3680710ad644e2845b071d61a8ef774b364a3f1f Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 21 Nov 2011 09:35:10 +0000 Subject: [PATCH 1/2] Accepting request 91993 from home:olta:haiku-admin The cgit build fix with respect to git-1.7.6 is incomplete: in the file ui-tree.c ls_tree() has been patched to use pathspec when invoking read_tree_recursive(), but cgit_print_tree() has not been touched. The resulting problem can be seen when browsing the tree of a cgit repository: when you "drill down" into subfolders, parts of the parent folder's contents will appear in the listing. This patch adjusts cgit_print_tree() accordingly, which fixes the problem. OBS-URL: https://build.opensuse.org/request/show/91993 OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/cgit?expand=0&rev=9 --- cgit-fix-print-tree.diff | 20 ++++++++++++++++++++ cgit.spec | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 cgit-fix-print-tree.diff diff --git a/cgit-fix-print-tree.diff b/cgit-fix-print-tree.diff new file mode 100644 index 0000000..fa40e80 --- /dev/null +++ b/cgit-fix-print-tree.diff @@ -0,0 +1,20 @@ +--- ui-tree.c 2011-11-17 18:00:20.036822908 +0100 ++++ ui-tree.c 2011-11-17 18:01:22.396236999 +0100 +@@ -262,6 +262,7 @@ + unsigned char sha1[20]; + struct commit *commit; + const char *paths[] = {path, NULL}; ++ struct pathspec pathspec; + + if (!rev) + rev = ctx.qry.head; +@@ -283,6 +284,8 @@ + } + + match_path = path; +- 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); + ls_tail(); + } diff --git a/cgit.spec b/cgit.spec index 0074c9a..22c4079 100644 --- a/cgit.spec +++ b/cgit.spec @@ -33,6 +33,7 @@ Source2: cgitrc Patch: cgit-optflags.diff Patch1: cgit-git-1.7.6_build_fix.patch Patch2: cgit-CVE-2011-2711-fix.diff +Patch3: cgit-fix-print-tree.diff # Requirements for cgit BuildRequires: gnu-crypto libopenssl-devel libzip-devel # Requirements for cgitrc man page generation @@ -53,6 +54,7 @@ Authors: %patch -p1 %patch1 -p1 %patch2 -p1 +%patch3 rm -rf git mv git-%{git_version} git From 1932761b62f0f350ce82539284000eea03b0d65a07e4febc499e1ea4bc0fcc82 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Tue, 22 Nov 2011 09:26:28 +0000 Subject: [PATCH 2/2] Add changes entry for recent patch addition. OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/cgit?expand=0&rev=10 --- cgit.changes | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cgit.changes b/cgit.changes index e79ba00..5fc9496 100644 --- a/cgit.changes +++ b/cgit.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Tue Nov 22 09:24:35 UTC 2011 - saschpe@suse.de + +- Add patch cgit-fix-print-tree.diff: + The cgit build fix with respect to git-1.7.6 is incomplete: in + the file ui-tree.c ls_tree() has been patched to use pathspec + when invoking read_tree_recursive(), but cgit_print_tree() has + no t been touched. + + The resulting problem can be seen when browsing the tree of a cgit + repository: when you "drill down" into subfolders, parts of the + parent folder's contents will appear in the listing. + + This patch adjusts cgit_print_tree() accordingly, which fixes the problem. + ------------------------------------------------------------------- Fri Oct 14 10:13:03 CEST 2011 - tiwai@suse.de