-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.7.1, 6.9.2, 6.10.3
-
6
-
Severity 2 - Major
-
4
-
Summary
When using repositories with Git Large File Storage (LFS) and a merging scheme such as Branch Updater, the merge fails with the following error in server logs:
2018-11-01 10:20:16,361 WARN [6-DelayedChangeDetectionThread:pool-12-thread-65] [ChainExecutionManagerImpl] Merge command error: com.atlassian.bamboo.plugins.git.GitCommandException: command [/bin/git merge --no-commit 370affcfbe4f62d50ecf04fb64ab7c559f093b62] failed with code 128. Working directory was [/bamboo-home/xml-data/build-dir/serverSide/PROJ-BRAN10-1/mergeWorkspace]., stderr: error: Your local changes to the following files would be overwritten by merge:
Steps to Reproduce
- Setup repository with LFS and 2 branches: master and develop
- Create plan at Bamboo and link to this repository
final Plan plan = new Plan(new Project() .key(new BambooKey("TEST")) .name("Test"), "LFS", new BambooKey("LFS")) .pluginConfigurations(new ConcurrentBuilds() .useSystemWideDefault(false)) .stages(new Stage("Default Stage") .jobs(new Job("Default Job", new BambooKey("JOB1")) .tasks(new VcsCheckoutTask() .description("Checkout Default Repository") .checkoutItems(new CheckoutItem().defaultRepository())))) .linkedRepositories("Mvnrepos") .triggers(new RepositoryPollingTrigger()) .planBranchManagement(new PlanBranchManagement() .createForPullRequest() .delete(new BranchCleanup() .whenRemovedFromRepositoryAfterDays(7) .whenInactiveInRepositoryAfterDays(30)) .branchIntegration(new BranchIntegration() .integrationBranch(new PlanBranchIdentifier(new BambooKey("LFS")))) .issueLinkingEnabled(false));
- Do a commit to develop branch which affects file under LFS control, e.g. sample.zip which should exists in both branches
- Do a commit to master branch which creates another file under LFS control, e.g. sample2.zip which exists only at master branch
- Create pull request at repository develop -> master and wait for build.
Expected Results
The branch merging succeed and the build will be sent to the queue
Actual Results
It will fail to merge develop and master branches with error message
error: Your local changes to the following files would be overwritten by checkout:
sample.zip
Please commit your changes or stash them before you switch branches.
Aborting
Workaround
There is no verified workaround.
We experience this for every LFS change in the branches vs the master when bamboo tries to merge the master with the branches before building. Our manual workaround is to manually rebase or merge the master in the branch when this occurs.
Using Bamboo server version 6.7.1 build 60705