diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-05-10 09:19:58 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-05-10 09:19:58 +0000 |
commit | 0717904e94aaa8bbdc4513781463e38f5f5ded7c (patch) | |
tree | 60e230be215ecdbbf02c16797abc836c87ece7a3 /main/git | |
parent | d11109c53833fc56337b9229cf313a7b6adb5bd4 (diff) | |
download | aports-0717904e94aaa8bbdc4513781463e38f5f5ded7c.tar.bz2 aports-0717904e94aaa8bbdc4513781463e38f5f5ded7c.tar.xz |
main/git: fix segfault when cherry-pick
Diffstat (limited to 'main/git')
-rw-r--r-- | main/git/APKBUILD | 16 | ||||
-rw-r--r-- | main/git/git-do-not-dump-core-when-iconv-fails.patch | 43 |
2 files changed, 53 insertions, 6 deletions
diff --git a/main/git/APKBUILD b/main/git/APKBUILD index 728fd7b19a..5d5153c2a2 100644 --- a/main/git/APKBUILD +++ b/main/git/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=git pkgver=1.7.1 -pkgrel=0 +pkgrel=1 pkgdesc="GIT - the stupid content tracker" url="http://git.or.cz/" license="GPL2" @@ -10,6 +10,7 @@ subpackages="$pkgname-doc $pkgname-perl" makedepends="zlib-dev openssl-dev curl-dev expat-dev perl-dev python-dev" source="http://kernel.org/pub/software/scm/git/git-$pkgver.tar.bz2 bb-tar.patch + git-do-not-dump-core-when-iconv-fails.patch " _makeopts="NO_ICONV=YesPlease @@ -17,14 +18,16 @@ _makeopts="NO_ICONV=YesPlease NO_TCLTK=YesPlease NO_SVN_TESTS=YesPlease" -build () { - cd $srcdir/$pkgname-$pkgver - patch -p1 -i ../bb-tar.patch || return 1 +build() { + cd "$srcdir"/$pkgname-$pkgver + patch -p1 -i "$srcdir"/bb-tar.patch || return 1 + patch -p1 -i "$srcdir"/git-do-not-dump-core-when-iconv-fails.patch \ + || return 1 make prefix=/usr DESTDIR="$pkgdir" $_makeopts || return 1 } package() { - cd $srcdir/$pkgname-$pkgver + cd "$srcdir"/$pkgname-$pkgver make prefix=/usr DESTDIR="$pkgdir" $_makeopts install } @@ -43,4 +46,5 @@ perl() { md5sums="3da231dbe82ad103373cb530ae7475d5 git-1.7.1.tar.bz2 -e63a201556c4f089de790805c09a2e5b bb-tar.patch" +e63a201556c4f089de790805c09a2e5b bb-tar.patch +7c660517316261b383a094ef03aad0aa git-do-not-dump-core-when-iconv-fails.patch" diff --git a/main/git/git-do-not-dump-core-when-iconv-fails.patch b/main/git/git-do-not-dump-core-when-iconv-fails.patch new file mode 100644 index 0000000000..b338ee4809 --- /dev/null +++ b/main/git/git-do-not-dump-core-when-iconv-fails.patch @@ -0,0 +1,43 @@ +commit 43acff34b902c38808ac0f326090f2516250e1f0 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Sat May 8 18:17:29 2010 -0500 + + cherry-pick: do not dump core when iconv fails + + When cherry-picking, usually the new and old commit encodings are both + UTF-8. Most old iconv implementations do not support this trivial + conversion, so on old platforms, out->message remains NULL, and later + attempts to read it segfault. + + Fix this by noticing the input and output encodings match and skipping + the iconv step, like the other reencode_string() call sites already do. + Also stop segfaulting on other iconv failures: if iconv fails for some + other reason, the best we can do is to pass the old message through. + + This fixes a regression introduced in v1.7.1-rc0~15^2~2 (revert: + clarify label on conflict hunks, 2010-03-20). + + Reported-by: Andreas Krey <a.krey@gmx.de> + Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> + Signed-off-by: Junio C Hamano <gitster@pobox.com> + +diff --git a/builtin/revert.c b/builtin/revert.c +index 778a56e..7d68ef7 100644 +--- a/builtin/revert.c ++++ b/builtin/revert.c +@@ -109,8 +109,13 @@ static int get_message(const char *raw_message, struct commit_message *out) + encoding = "UTF-8"; + if (!git_commit_encoding) + git_commit_encoding = "UTF-8"; +- if ((out->reencoded_message = reencode_string(raw_message, +- git_commit_encoding, encoding))) ++ ++ out->reencoded_message = NULL; ++ out->message = raw_message; ++ if (strcmp(encoding, git_commit_encoding)) ++ out->reencoded_message = reencode_string(raw_message, ++ git_commit_encoding, encoding); ++ if (out->reencoded_message) + out->message = out->reencoded_message; + + abbrev = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV); |