Skip to content

Commit a787216

Browse files
fix(GitModule): add enable_lfs param to git.origin
- "false" by default - value passed to call to GitOrigin.newGitOrigin, just like for github_origin - allows for LFS usage with any Git backend that supports LFS, e.g. GitLab Co-authored-by: Ashraful Islam <ashraful@presagetech.com>
1 parent ba0bcf3 commit a787216

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/com/google/copybara/git/GitModule.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ public GitModule(Options options) {
297297
+ " fall back to the 'ref' param.\n"
298298
+ "This is intended to help migrating to the new standard of using 'main'"
299299
+ " without breaking users relying on the legacy default."),
300+
@Param(
301+
name = "enable_lfs",
302+
defaultValue = "False",
303+
named = true,
304+
positional = false,
305+
doc = "If true, Large File Storage support is enabled for the origin."),
300306
@Param(
301307
name = "credentials",
302308
allowedTypes = {
@@ -322,6 +328,7 @@ public GitOrigin origin(
322328
Object describeVersion,
323329
Object versionSelector,
324330
Boolean primaryBranchMigration,
331+
Boolean enableLfs,
325332
@Nullable Object credentials,
326333
StarlarkThread thread)
327334
throws EvalException {
@@ -360,7 +367,7 @@ public GitOrigin origin(
360367
? githubPostSubmitApprovalsProvider(
361368
fixedUrl, SkylarkUtil.convertOptionalString(ref), credentialHandler)
362369
: approvalsProvider(url),
363-
/* enableLfs= */ false,
370+
enableLfs,
364371
credentialHandler
365372
);
366373
}

0 commit comments

Comments
 (0)