Skip to content

Pass --renormalize during git add to fix LFS usage in destination repo #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion java/com/google/copybara/git/GitDestination.java
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,11 @@ public ImmutableList<DestinationEffect> write(TransformResult transformResult,

console.progress("Git Destination: Adding all files");
try (ProfilerTask ignored = generalOptions.profiler().start("add_files")) {
alternate.add().force().renormalize().all().run();
if(generalOptions.isForced()){
alternate.add().force().all().run();
}else{
alternate.add().force().renormalize().all().run();
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discovered that, on initial sync of a branch w/ --force flag usage in global options, adding --renormalize results in a situation where no new files are added to that initial destination commit. Hence the conditional. Perhaps this isn't the best design; if so, we request reviewer's input on what can be a better design.

}

console.progress("Git Destination: Excluding files");
Expand Down