[PATCH v3 2/2] shortlog: Test reading a log from a SHA256 repo in a non-git directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



git-shortlog(1) might be used outside of a git repository to process a
log obtained from a repository initialized with --object-format=sha256.
Since git-shortlog(1) has no information on the hash algorithm, make
sure that it can still successfully process the log regardless.

Signed-off-by: Wolfgang Müller <wolf@oriole.systems>
Thanks-to: Patrick Steinhardt <ps@xxxxxx>
---
 t/t4201-shortlog.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 0cc2aa5089..50d987cbe4 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -147,6 +147,14 @@ fuzz()
 	echo | nongit git shortlog --author=author
 '
 
+test_expect_success 'shortlog from non-git directory reads log from SHA256 repository' '
+	test_when_finished "rm -rf repo" &&
+	git init --object-format=sha256 repo &&
+	test_commit -C repo initial &&
+	git -C repo log HEAD >log &&
+	nongit git shortlog <log
+'
+
 test_expect_success 'shortlog should add newline when input line matches wraplen' '
 	cat >expect <<\EOF &&
 A U Thor (2):
-- 
2.47.0





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux