From e493fcdb039d5a82384ea3752f70113ed8f7e272 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 15 Jul 2026 09:06:58 +0900 Subject: [PATCH] git: don't fall through to writing a literal '-' file after download already printed the object to stdout. --- git.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git.go b/git.go index 0f0ae53..74b6d2b 100644 --- a/git.go +++ b/git.go @@ -635,9 +635,10 @@ aside from those, there is also: if outputPath == "-" { if _, err = os.Stdout.Write(obj.Data); err != nil { - log("\nprinted object %s to stdout\n", color.CyanString(obj.Hash)) return err } + log("\nprinted object %s to stdout\n", color.CyanString(obj.Hash)) + return nil } if err := os.WriteFile(outputPath, obj.Data, 0644); err != nil {