* [PATCH 1/1] git: update to v2.13.2
@ 2017-07-05 8:43 list
2017-07-05 8:45 ` list
0 siblings, 1 reply; 3+ messages in thread
From: list @ 2017-07-05 8:43 UTC (permalink / raw)
From: Christian Hesse <mail at eworm.de>
Update to git version v2.13.2: With commit 8aee769f (pathspec: copy and free
owned memory) the definition of struct pathspec_item has changed with the
expectation that pathspecs will be managed dynamically. We work around this
a bit by setting up a static structure, but let's allocate the match string
to avoid needing to cast away const.
Updated a patch from John Keeping <john at keeping.me.uk> for git v2.12.1.
Signed-off-by: Christian Hesse <mail at eworm.de>
---
Makefile | 2 +-
git | 2 +-
shared.c | 4 +++-
ui-blob.c | 9 ++++++---
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index fe6cc98..9e1df97 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir)
mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.11.0
+GIT_VER = 2.13.2
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
INSTALL = install
COPYTREE = cp -r
diff --git a/git b/git
index 454cb6b..8c8e978 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 454cb6bd52a4de614a3633e4f547af03d5c3b640
+Subproject commit 8c8e978f5719c6a58fb998742207bf907f963143
diff --git a/shared.c b/shared.c
index c63f1e3..13a65a9 100644
--- a/shared.c
+++ b/shared.c
@@ -352,7 +352,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
opt.format_callback = cgit_diff_tree_cb;
opt.format_callback_data = fn;
if (prefix) {
- item.match = prefix;
+ item.match = xstrdup(prefix);
item.len = strlen(prefix);
opt.pathspec.nr = 1;
opt.pathspec.items = &item;
@@ -365,6 +365,8 @@ void cgit_diff_tree(const struct object_id *old_oid,
diff_root_tree_sha1(new_oid->hash, "", &opt);
diffcore_std(&opt);
diff_flush(&opt);
+
+ free(item.match);
}
void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
diff --git a/ui-blob.c b/ui-blob.c
index 5f30de7..793817f 100644
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -38,7 +38,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
struct object_id oid;
unsigned long size;
struct pathspec_item path_items = {
- .match = path,
+ .match = xstrdup(path),
.len = strlen(path)
};
struct pathspec paths = {
@@ -53,10 +53,13 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
};
if (get_oid(ref, &oid))
- return 0;
+ goto done;
if (sha1_object_info(oid.hash, &size) != OBJ_COMMIT)
- return 0;
+ goto done;
read_tree_recursive(lookup_commit_reference(oid.hash)->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
+
+done:
+ free(path_items.match);
return walk_tree_ctx.found_path;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] git: update to v2.13.2
2017-07-05 8:43 [PATCH 1/1] git: update to v2.13.2 list
@ 2017-07-05 8:45 ` list
2017-07-22 11:01 ` john
0 siblings, 1 reply; 3+ messages in thread
From: list @ 2017-07-05 8:45 UTC (permalink / raw)
Christian Hesse <list at eworm.de> on Wed, 2017/07/05 10:43:
> From: Christian Hesse <mail at eworm.de>
>
> Update to git version v2.13.2: With commit 8aee769f (pathspec: copy and free
> owned memory) the definition of struct pathspec_item has changed with the
> expectation that pathspecs will be managed dynamically. We work around this
> a bit by setting up a static structure, but let's allocate the match string
> to avoid needing to cast away const.
>
> Updated a patch from John Keeping <john at keeping.me.uk> for git v2.12.1.
John, please complain if you want to send this in. ;)
--
main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH"
"CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];)
putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20170705/899a5903/attachment.asc>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] git: update to v2.13.2
2017-07-05 8:45 ` list
@ 2017-07-22 11:01 ` john
0 siblings, 0 replies; 3+ messages in thread
From: john @ 2017-07-22 11:01 UTC (permalink / raw)
On Wed, Jul 05, 2017 at 10:45:15AM +0200, Christian Hesse wrote:
> Christian Hesse <list at eworm.de> on Wed, 2017/07/05 10:43:
> > From: Christian Hesse <mail at eworm.de>
> >
> > Update to git version v2.13.2: With commit 8aee769f (pathspec: copy and free
> > owned memory) the definition of struct pathspec_item has changed with the
> > expectation that pathspecs will be managed dynamically. We work around this
> > a bit by setting up a static structure, but let's allocate the match string
> > to avoid needing to cast away const.
> >
> > Updated a patch from John Keeping <john at keeping.me.uk> for git v2.12.1.
>
> John, please complain if you want to send this in. ;)
No, I haven't had much time for CGit recently, so I'm happy for someone
else to take over!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-22 11:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 8:43 [PATCH 1/1] git: update to v2.13.2 list
2017-07-05 8:45 ` list
2017-07-22 11:01 ` john
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).