git: update to v2.2.1

Update to git version v2.2.1, including API changes.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2014-12-19 00:28:34 -07:00 committed by Jason A. Donenfeld
parent 10c5680efb
commit 17838ec630
5 changed files with 9 additions and 8 deletions

View File

@ -14,7 +14,7 @@ htmldir = $(docdir)
pdfdir = $(docdir) pdfdir = $(docdir)
mandir = $(prefix)/share/man mandir = $(prefix)/share/man
SHA1_HEADER = <openssl/sha.h> SHA1_HEADER = <openssl/sha.h>
GIT_VER = 2.0.4 GIT_VER = 2.2.1
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
INSTALL = install INSTALL = install
COPYTREE = cp -r COPYTREE = cp -r

2
cgit.c
View File

@ -457,7 +457,7 @@ static char *guess_defbranch(void)
const char *ref; const char *ref;
unsigned char sha1[20]; unsigned char sha1[20];
ref = resolve_ref_unsafe("HEAD", sha1, 0, NULL); ref = resolve_ref_unsafe("HEAD", 0, sha1, NULL);
if (!ref || !starts_with(ref, "refs/heads/")) if (!ref || !starts_with(ref, "refs/heads/"))
return "master"; return "master";
return xstrdup(ref + 11); return xstrdup(ref + 11);

2
git

@ -1 +1 @@
Subproject commit 32f56600bb6ac6fc57183e79d2c1515dfa56672f Subproject commit 9b7cbb315923e61bb0c4297c701089f30e116750

View File

@ -56,11 +56,11 @@ static void inspect_files(struct diff_filepair *pair)
void show_commit_decorations(struct commit *commit) void show_commit_decorations(struct commit *commit)
{ {
struct name_decoration *deco; const struct name_decoration *deco;
static char buf[1024]; static char buf[1024];
buf[sizeof(buf) - 1] = 0; buf[sizeof(buf) - 1] = 0;
deco = lookup_decoration(&name_decoration, &commit->object); deco = get_name_decoration(&commit->object);
html("<span class='decoration'>"); html("<span class='decoration'>");
while (deco) { while (deco) {
if (starts_with(deco->name, "refs/heads/")) { if (starts_with(deco->name, "refs/heads/")) {

View File

@ -17,16 +17,17 @@ static time_t read_agefile(char *path)
time_t result; time_t result;
size_t size; size_t size;
char *buf; char *buf;
static char buf2[64]; struct strbuf date_buf = STRBUF_INIT;
if (readfile(path, &buf, &size)) if (readfile(path, &buf, &size))
return -1; return -1;
if (parse_date(buf, buf2, sizeof(buf2)) > 0) if (parse_date(buf, &date_buf) == 0)
result = strtoul(buf2, NULL, 10); result = strtoul(date_buf.buf, NULL, 10);
else else
result = 0; result = 0;
free(buf); free(buf);
strbuf_release(&date_buf);
return result; return result;
} }