aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--Makefile2
m---------git0
-rw-r--r--shared.c4
-rw-r--r--ui-blob.c9
4 files changed, 5 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 3d792ce..fe6cc98 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.13.4
+GIT_VER = 2.11.0
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
-Subproject cf8899d285d2648013040ec7196ffd3de060666
+Subproject 454cb6bd52a4de614a3633e4f547af03d5c3b64
diff --git a/shared.c b/shared.c
index 13a65a9..c63f1e3 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 = xstrdup(prefix);
+ item.match = prefix;
item.len = strlen(prefix);
opt.pathspec.nr = 1;
opt.pathspec.items = &item;
@@ -365,8 +365,6 @@ 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 793817f..5f30de7 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 = xstrdup(path),
+ .match = path,
.len = strlen(path)
};
struct pathspec paths = {
@@ -53,13 +53,10 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
};
if (get_oid(ref, &oid))
- goto done;
+ return 0;
if (sha1_object_info(oid.hash, &size) != OBJ_COMMIT)
- goto done;
+ return 0;
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;
}