Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
805ae952
Commit
805ae952
authored
5 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
fix: rebase if package file not found in existing branch
parent
7886c7a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/branch/get-updated.js
+8
-0
8 additions, 0 deletions
lib/workers/branch/get-updated.js
test/workers/branch/get-updated.spec.js
+1
-0
1 addition, 0 deletions
test/workers/branch/get-updated.spec.js
with
9 additions
and
0 deletions
lib/workers/branch/get-updated.js
+
8
−
0
View file @
805ae952
...
...
@@ -22,6 +22,14 @@ async function getUpdatedPackageFiles(config) {
const
existingContent
=
updatedFileContents
[
packageFile
]
||
(
await
platform
.
getFile
(
packageFile
,
config
.
parentBranch
));
// istanbul ignore if
if
(
config
.
parentBranch
&&
!
existingContent
)
{
logger
.
info
(
'
Rebasing branch after file not found
'
);
return
getUpdatedPackageFiles
({
...
config
,
parentBranch
:
undefined
,
});
}
let
newContent
=
existingContent
;
const
updateDependency
=
get
(
manager
,
'
updateDependency
'
);
newContent
=
await
updateDependency
(
existingContent
,
upgrade
);
...
...
This diff is collapsed.
Click to expand it.
test/workers/branch/get-updated.spec.js
+
1
−
0
View file @
805ae952
...
...
@@ -16,6 +16,7 @@ describe('workers/branch/get-updated', () => {
composer
.
updateDependency
=
jest
.
fn
();
composer
.
getArtifacts
=
jest
.
fn
();
npm
.
updateDependency
=
jest
.
fn
();
platform
.
getFile
.
mockReturnValueOnce
(
'
existing content
'
);
});
it
(
'
handles empty
'
,
async
()
=>
{
const
res
=
await
getUpdatedPackageFiles
(
config
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment