fix(cli): fall back to regular upload when git filtering excludes all files#1783
Open
russellb wants to merge 2 commits into
Open
fix(cli): fall back to regular upload when git filtering excludes all files#1783russellb wants to merge 2 commits into
russellb wants to merge 2 commits into
Conversation
… files When uploading a directory whose contents are entirely excluded by .gitignore, git_sync_files returns an empty file list. The git-aware upload path silently accepted this and printed "Upload complete" without transferring any files. Now both call sites (direct CLI handler and sandbox_upload_plan) check for an empty file list and fall through to the regular, unfiltered upload path instead. Closes NVIDIA#1778 Signed-off-by: Russell Bryant <rbryant@nvidia.com>
maxamillion
previously approved these changes
Jun 5, 2026
…#1778) Reproduces the reported workflow: download a file from a sandbox into a local git repo where the target directory is gitignored, then re-upload that directory without --no-git-ignore. Before the fix the upload silently succeeded with zero files transferred. Signed-off-by: Russell Bryant <rbryant@nvidia.com>
Collaborator
|
/ok to test 6d322fd |
Collaborator
PR Review StatusValidation: This PR is project-valid because it directly fixes validated issue #1778 for Independent review: completed in this cycle. No critical correctness blockers were found in the core fallback or regression coverage. Review feedback still needs author or maintainer resolution before pipeline handoff:
E2E: This change affects sandbox file transfer behavior and adds an E2E regression test, so Next state: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When uploading a directory whose contents are entirely excluded by
.gitignore,git_sync_filesreturns an empty file list. The git-aware upload path silently accepted this and printed "Upload complete" without transferring any files. Now both call sites check for an empty file list and fall through to the regular, unfiltered upload path instead.Related Issue
Closes #1778
Changes
main.rs: Added!files.is_empty()guard to the git-aware upload branch so an empty git file list falls through to the regular uploadrun.rs: Added the same guard insandbox_upload_plan()so thesandbox runupload path also falls back correctlysandbox_upload_plan_falls_back_when_all_files_gitignoredconfirming a gitignored directory produces aRegularupload planTesting
mise run pre-commitpassesChecklist