Skip to content

fast-import: catch missing data after inline M at EOF - #2323

Open
marinelay wants to merge 1 commit into
gitgitgadget:masterfrom
marinelay:fast-import-inline-eof
Open

marinelay wants to merge 1 commit into
gitgitgadget:masterfrom
marinelay:fast-import-inline-eof

Conversation

@marinelay

Copy link
Copy Markdown

No description provided.

If `M <mode> inline <path>` appears at the end of input,
file_change_m() exits its read loop on EOF without reading a `data`
command. It then puts an uninitialized stack object ID into the tree
and exits 0, leaving a tree entry for a missing blob that `git fsck`
flags.

note_change_n() avoids this by calling parse_and_store_blob() at EOF,
which dies on the missing `data` command. Do the same in
file_change_m(), and add a test.

Signed-off-by: Wonseok Oh <marinelay7@gmail.com>
@marinelay

Copy link
Copy Markdown
Author

/preview

@gitgitgadget

gitgitgadget Bot commented Nov 21, 2026

Copy link
Copy Markdown

Preview email sent as pull.2323.git.1795246706413.gitgitgadget@gmail.com

@marinelay

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Nov 21, 2026

Copy link
Copy Markdown

Submitted as pull.2323.git.1795246845186.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2323/marinelay/fast-import-inline-eof-v1

To fetch this version to local tag pr-2323/marinelay/fast-import-inline-eof-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2323/marinelay/fast-import-inline-eof-v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant