From 86b8af14954a90d0f3f28d4db3a156b068c01611 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 20 Jun 2026 09:32:57 +0800 Subject: [PATCH] fix: keep package hashes indifferent to line endings when `ya pkg` pulls packages --- CHANGELOG.md | 4 ++++ yazi-cli/src/package/git.rs | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc2923f5..c6c209e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): - Deprecate `backward --far` and `forward --far` in favor of `backward wide` and `forward wide`, respectively ([#4012]) +### Fixed + +- Keep package hashes indifferent to line endings when `ya pkg` pulls packages + ### Improved - Eliminate hacks in image and UI conflict resolution ([#4022]) diff --git a/yazi-cli/src/package/git.rs b/yazi-cli/src/package/git.rs index 3d1e85df..506b54d5 100644 --- a/yazi-cli/src/package/git.rs +++ b/yazi-cli/src/package/git.rs @@ -45,11 +45,15 @@ impl Git { async fn exec(f: impl FnOnce(&mut Command) -> &mut Command) -> Result<()> { let status = f(Command::new("git").args([ "-c", - "advice.detachedHead=false", + "core.eol=lf", + "-c", + "core.autocrlf=false", + "-c", + "clone.defaultRemoteName=origin", "-c", "checkout.defaultRemote=origin", "-c", - "clone.defaultRemoteName=origin", + "advice.detachedHead=false", ])) .status() .await