Control: tag -1 patch

On Sun, Oct 06, 2024 at 08:34:31PM +0200, gregor herrmann wrote:
> Source: libgit-raw-perl
> Version: 0.90+ds-2
> Severity: serious
> Tags: ftbfs trixie sid
> Justification: fails to build from source (but built successfully in the past)
> X-Debbugs-Cc: libg...@packages.debian.org
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> libgit2 was updated to 1.8.2~rc1+ds-2 in unstable. During the binNMU
> libgit-raw-perl failed:
> 
> https://buildd.debian.org/status/logs.php?pkg=libgit-raw-perl&ver=0.90%2Bds-2%2Bb3
> 
> #   Failed test at t/17-filter.t line 148.
> #                   'no error at t/17-filter.t line 147'
> #     doesn't match '(?^:Throwing an exception here!)'
> # Looks like you failed 1 test of 38.

I think (but didn't verify) that this broke with

  
https://github.com/libgit2/libgit2/commit/3618a2aa45893a88fbb2d1e0eb97d530c7dc4f4d

Looks like S_git_check_error() needs to adapt.

Patch attached, this makes the test pass for me.
-- 
Niko
>From cec39e5efebba62e7464aa88ee0cbe296d1c6d9b Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Mon, 14 Oct 2024 19:32:09 +0100
Subject: [PATCH] S_git_check_error: adapt to libgit2 1.8.0 change

giterr_last() no longer returns NULL for no error since

 https://github.com/libgit2/libgit2/commit/3618a2aa45893a88fbb2d1e0eb97d530c7dc4f4d

Bug-Debian: https://bugs.debian.org/1084214
---
 Raw.xs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Raw.xs b/Raw.xs
index bb17ff0d..1e67a7ae 100644
--- a/Raw.xs
+++ b/Raw.xs
@@ -308,7 +308,7 @@ STATIC void S_git_check_error(int err, const char *file, int line) {
 
 		e = create_error_obj(err, GITERR_NONE, NULL);
 
-		if ((error = giterr_last()) != NULL) {
+		if ((error = giterr_last()) != NULL && error->klass != GIT_ERROR_NONE) {
 			e -> category = error -> klass;
 			e -> message = newSVpv(error -> message, 0);
 		} else if (SvTRUE(ERRSV)) {
-- 
2.45.2

Reply via email to