[Bug] isomorphic-git cherry-pick overwrites a dirty tracked file
Summary
git.cherryPick silently replaces a tracked worktree file containing local
changes. It returns a new commit and exposes no overwrite/force option. The
attached Git control rejects the same tracked-dirty operation and preserves the
local bytes.
Steps
unzip attachments.zip
cd attachments
ISOGIT_DIR=../isomorphic-git ./reproduce.sh isogit-cherry-pick-reproThe output includes isogit_rc=0, isogit_local_bytes_lost=yes, and
control_git_preserved=yes. Detailed source analysis and exact revisions are
in report.md.
Environment and usage
- Runtime: Node.js (not the browser).
- Usage: Node ESM import with the Node filesystem adapter; no bundler,
<script>tag, or CDN is involved. - Tested with isomorphic-git v1.42.2 and the pinned main revision.
Version
v1.42.2 and main at
66ae89c3ae33ab4932d75c0e19fd2c45c8ee2630.
Disclosure note
The report and reproduction code were assisted by an LLM. I personally reviewed the analysis and confirmed the behavior with the attached reproducer. I apologize if this LLM assistance creates extra work; the additional detail is intended to make the behavior and fix location easier to verify.
Attachments
Source: isomorphic-git/isomorphic-git