]> granicus.if.org Git - cgit/commitdiff
git: update to v2.5.0
authorChristian Hesse <mail@eworm.de>
Tue, 28 Jul 2015 08:42:01 +0000 (10:42 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 12 Aug 2015 12:09:05 +0000 (14:09 +0200)
Update to git version v2.5.0.

* Upstream commit 5455ee0573a22bb793a7083d593ae1ace909cd4c (Merge branch
  'bc/object-id') changed API:

  for_each_ref() callback functions were taught to name the objects
  not with "unsigned char sha1[20]" but with "struct object_id".

* Upstream commit dcf692625ac569fefbe52269061230f4fde10e47 (path.c: make
  get_pathname() call sites return const char *)

Signed-off-by: Christian Hesse <mail@eworm.de>
Makefile
cgit.c
cgit.h
git
shared.c
ui-clone.c
ui-log.c
ui-shared.c

index 1f84c00b46d59a5bef7153d0d92a3edc13d79ef1..65b43181df3f13a309a1e104bce860e2e9f00492 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 2.4.1
+GIT_VER = 2.5.0
 GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
 INSTALL = install
 COPYTREE = cp -r
diff --git a/cgit.c b/cgit.c
index 8c9cfb5e87ad9343f21b6cc0b032575969e4b914..ed026142a4fce1f9c9f6d94a094a21ec8f9ae87d 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -421,7 +421,7 @@ struct refmatch {
        int match;
 };
 
-static int find_current_ref(const char *refname, const unsigned char *sha1,
+static int find_current_ref(const char *refname, const struct object_id *oid,
                            int flags, void *cb_data)
 {
        struct refmatch *info;
diff --git a/cgit.h b/cgit.h
index 16f809297fc40d9eedf95a80fcaf7e4caaefb26f..db9a8ebefa76d820a94668334da5936b439fea77 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -335,7 +335,7 @@ extern void strbuf_ensure_end(struct strbuf *sb, char c);
 
 extern void cgit_add_ref(struct reflist *list, struct refinfo *ref);
 extern void cgit_free_reflist_inner(struct reflist *list);
-extern int cgit_refs_cb(const char *refname, const unsigned char *sha1,
+extern int cgit_refs_cb(const char *refname, const struct object_id *oid,
                        int flags, void *cb_data);
 
 extern void *cgit_free_commitinfo(struct commitinfo *info);
diff --git a/git b/git
index aaa7e0d7f8f003c0c8ab34f959083f6d191d44ca..a17c56c056d5fea0843b429132904c429a900229 160000 (submodule)
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit aaa7e0d7f8f003c0c8ab34f959083f6d191d44ca
+Subproject commit a17c56c056d5fea0843b429132904c429a900229
index a99173b6113c058cef503e76042a575d1bdbf127..a83afcb3e275bed29d41ec779bf019ddde7589c5 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -185,13 +185,13 @@ void cgit_add_ref(struct reflist *list, struct refinfo *ref)
        list->refs[list->count++] = ref;
 }
 
-static struct refinfo *cgit_mk_refinfo(const char *refname, const unsigned char *sha1)
+static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_id *oid)
 {
        struct refinfo *ref;
 
        ref = xmalloc(sizeof (struct refinfo));
        ref->refname = xstrdup(refname);
-       ref->object = parse_object(sha1);
+       ref->object = parse_object(oid->hash);
        switch (ref->object->type) {
        case OBJ_TAG:
                ref->tag = cgit_parse_tag((struct tag *)ref->object);
@@ -239,11 +239,11 @@ void cgit_free_reflist_inner(struct reflist *list)
        free(list->refs);
 }
 
-int cgit_refs_cb(const char *refname, const unsigned char *sha1, int flags,
+int cgit_refs_cb(const char *refname, const struct object_id *oid, int flags,
                  void *cb_data)
 {
        struct reflist *list = (struct reflist *)cb_data;
-       struct refinfo *info = cgit_mk_refinfo(refname, sha1);
+       struct refinfo *info = cgit_mk_refinfo(refname, oid);
 
        if (info)
                cgit_add_ref(list, info);
index e35d3d310e1434852a956718d75eecd2e0059265..e4ddd34932f8182033267d2a439f6b76950a730f 100644 (file)
 #include "html.h"
 #include "ui-shared.h"
 
-static int print_ref_info(const char *refname, const unsigned char *sha1,
+static int print_ref_info(const char *refname, const struct object_id *oid,
                           int flags, void *cb_data)
 {
        struct object *obj;
 
-       if (!(obj = parse_object(sha1)))
+       if (!(obj = parse_object(oid->hash)))
                return 0;
 
-       htmlf("%s\t%s\n", sha1_to_hex(sha1), refname);
+       htmlf("%s\t%s\n", oid_to_hex(oid), refname);
        if (obj->type == OBJ_TAG) {
                if (!(obj = deref_tag(obj, refname, 0)))
                        return 0;
@@ -50,7 +50,7 @@ static void print_pack_info(void)
        }
 }
 
-static void send_file(char *path)
+static void send_file(const char *path)
 {
        struct stat st;
 
index 32b4c4734d0cc26b457fc45c26d0fd8f31089e62..8028b27a0679f006ffae5a724d307b8e3bc73e6e 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -249,11 +249,11 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 
 static const char *disambiguate_ref(const char *ref, int *must_free_result)
 {
-       unsigned char sha1[20];
+       struct object_id oid;
        struct strbuf longref = STRBUF_INIT;
 
        strbuf_addf(&longref, "refs/heads/%s", ref);
-       if (get_sha1(longref.buf, sha1) == 0) {
+       if (get_sha1(longref.buf, oid.hash) == 0) {
                *must_free_result = 1;
                return strbuf_detach(&longref, NULL);
        }
index ac5a2871e3625fb3c4d6a5e1f30cb1bb65561022..e755c92d79878a292f165cfcad23d66c6a6d8bcc 100644 (file)
@@ -792,7 +792,7 @@ void cgit_add_clone_urls(void (*fn)(const char *))
                add_clone_urls(fn, ctx.cfg.clone_prefix, ctx.repo->url);
 }
 
-static int print_branch_option(const char *refname, const unsigned char *sha1,
+static int print_branch_option(const char *refname, const struct object_id *oid,
                               int flags, void *cb_data)
 {
        char *name = (char *)refname;