From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender3-pp-f112.zoho.com (sender3-pp-f112.zoho.com [136.143.184.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4285031354D for ; Tue, 14 Oct 2025 12:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.184.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760444888; cv=pass; b=Yh7Hf4Z/VJcukG/mo7zvtQgKw5VtWGG37Cck8buX/RW9uiV1H2LBsLWrAdVTYVEqV6tzaQceexV/tElHIKMZPJiVWuQ91oIJRfwdBxv0KL+KLdDHawWB9pHBwDLXN6wjZnL8llkB98HMlb7dwoWLgV3nSj0KHFunfzuUJ8cM0hI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760444888; c=relaxed/simple; bh=YP0J1A0EHmRTR6r4jPnjZslF0nLO9OMng19ng3wpu7A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jWFmIit33DQLcNEywn8GxzhEFp3LHcbFBBCXwGKoQcMfGpx4xtNLOm+2NHIUEL8dQXIMxmwYNwF0AEMEkOi+VklgfRJOMJWrooJeqNQ+IXtYKU2CQLNZxTBq9LDiqMaXmheWBvUUcNlghkK7Vs2k1NAkl3dT/KIeHsn+6gHo39w= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=JWkZF+PF; arc=pass smtp.client-ip=136.143.184.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="JWkZF+PF" ARC-Seal: i=1; a=rsa-sha256; t=1760444763; cv=none; d=zohomail.com; s=zohoarc; b=PmAc7wAUIsvE1Jn3mmZ6B2eqInyC9TEjj1EMwqwAS/r6HzzH7o5ZRsq55P+U4P1fZlxA0+j9X3KghK8nAZThyTL5e/vCZN/Cx+tNwH2In/5yzt9XU7XY7k9EOWHi/UyXgSmVafKDm68ZHuVmstbzxhnSnM36S2SJoKJn2vpaNCg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760444763; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=bEL/oyLS+z036duVl6pzLscNZMgda9TZshIzv9iNhzw=; b=P0TPQwfWq49T4yjS/ul+h0Xb8HB9b8bpovWTyG8iOQF+ZGWA1GCeUysUp8xcXN4B2u3PZChzx7orl+S1FACuonKNrCCs1zRCccGt/Xe8m73yZ7Ean3BDJoyd6m836BNij3X8sZy6Kq9ss3TlPL34LF4CgzhZ7Fv7mFFMEG+9Vwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1760444763; s=zmail; d=linux.beauty; i=me@linux.beauty; h=From:From:To:To:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=bEL/oyLS+z036duVl6pzLscNZMgda9TZshIzv9iNhzw=; b=JWkZF+PFGX08H780xZx2htr+KCrGp9FInMOtkAChqCylbvJuONaie+Rl8Tx/b2PB mfIBWGWlRBCZqJTcIR1UeXsxIp0MLM+l1hwXRnf9UTEtG10n6CDpHM9q9KzY6ozhDF0 FmHF2bJtVq+jQ32qXd5aLq6veuVAFqjc8wie+Ye0= Received: by mx.zohomail.com with SMTPS id 1760444754596432.8800520496393; Tue, 14 Oct 2025 05:25:54 -0700 (PDT) From: Li Chen To: "phillipwood" , "git" , "Junio C Hamano" Subject: [PATCH v4 19/29] tests: t3440: use test_commit_message for trailer checks Date: Tue, 14 Oct 2025 20:24:32 +0800 Message-ID: <20251014122452.1851103-20-me@linux.beauty> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251014122452.1851103-1-me@linux.beauty> References: <20251014122452.1851103-1-me@linux.beauty> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External Replaced the pipeline-based trailer assertions with explicit expectations verified by test_commit_message, ensuring the rebase trailer tests catch git command failures reliably. Signed-off-by: Li Chen --- t/t3440-rebase-trailer.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/t/t3440-rebase-trailer.sh b/t/t3440-rebase-trailer.sh index 6f1a062e8f..16b059c2c3 100755 --- a/t/t3440-rebase-trailer.sh +++ b/t/t3440-rebase-trailer.sh @@ -52,18 +52,28 @@ test_expect_success 'reject trailer with missing key before separator' ' test_expect_success 'CLI trailer duplicates allowed; replace policy keeps last' ' git reset --hard third && - git -c trailer.Bug.ifexists=replace -c trailer.Bug.ifmissing=add rebase -m --trailer "Bug: 123" --trailer "Bug: 456" HEAD~1 && - git cat-file commit HEAD | grep "^Bug: 456" && - git cat-file commit HEAD | grep -v "^Bug: 123" + git -c trailer.Bug.ifexists=replace -c trailer.Bug.ifmissing=add \ + rebase -m --trailer "Bug: 123" --trailer "Bug: 456" HEAD~1 && + cat >expect <<-\EOF && + third + + Bug: 456 + EOF + test_commit_message HEAD expect ' test_expect_success 'multiple Signed-off-by trailers all preserved' ' git reset --hard third && git rebase -m \ - --trailer "Signed-off-by: Dev A " \ - --trailer "Signed-off-by: Dev B " HEAD~1 && - git cat-file commit HEAD | grep -c "^Signed-off-by:" >count && - test "$(cat count)" = 2 # two new commits + --trailer "Signed-off-by: Dev A " \ + --trailer "Signed-off-by: Dev B " HEAD~1 && + cat >expect <<-\EOF && + third + + Signed-off-by: Dev A + Signed-off-by: Dev B + EOF + test_commit_message HEAD expect ' test_expect_success 'rebase -m --trailer adds trailer after conflicts' ' -- 2.51.0