Repository navigation
Honor ignore-private for existing backups - #236
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
Owner
|
@dajiaohuang thanks for the PR. Can i confirm you verified the fix with a real run with one of the supported git hosts? |
Author
|
No—I did not verify it with a real supported Git host. I reproduced the existing-backup path with a synthetic in-memory regression and ran the focused tests plus the safe package suite. I did not run an actual backup job or clone against a remote host/account, so real-host behavior remains unverified. |
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.
Problem
-ignore-privatewas enforced only while cloning a new repository. When a private repository already existed in the backup directory,backUpselectedupdateExistingRepofirst, so it was still updated despite the exclusion option.Change
Skip private repositories at the start of
backUp, before checking the destination path. This applies the option to both new and existing backups. The regression test uses an in-memory filesystem and a synthetic failing Git command to prove an existing private repository is not updated.Verification
go test -mod=readonly . -skip 'ArchiveDownloadFail' -count=1passed on Go 1.26.3 / Windows amd64. The two excluded archive-failure tests redirect to127.0.0.1:8080; they were not run to avoid contacting a potentially live local service.gofmt -d backup.go backup_test.goandgit diff --checkpassed.