Skip to content

Commit

Permalink
chore(backmerge): remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianpaquier committed May 4, 2024
1 parent 218ec54 commit a8da0f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 10 additions & 2 deletions lib/backmerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export const getBranches = async (context: Context, config: BackmergeConfig) =>
context.logger.log(`Current branch '${releaseBranch}' matches following configured backmerge targets: '${JSON.stringify(appropriates)}'. Performing backmerge.`)

const git = new Git(context.cwd, context.env)
await git.fetchAllRemotes()

// ensure at any time and any moment that the fetch'ed remote url is the same as there
// https://github.com/semantic-release/git/blob/master/lib/prepare.js#L69
// it's to ensure that the commit done during @semantic-release/git is backmerged alongside the other commits
await git.fetch(config.repositoryUrl)

const branches = (await git.ls(config.repositoryUrl)).
Expand Down Expand Up @@ -114,8 +117,13 @@ export const executeBackmerge = async (context: Context, config: BackmergeConfig
const authRemote = authModificator(url, config.platform, config.token)

const git = new Git(context.cwd, context.env)
// await git.fetchAllRemotes()

// ensure at any time and any moment that the fetch'ed remote url is the same as there
// https://github.com/semantic-release/git/blob/master/lib/prepare.js#L69
// it's to ensure that the commit done during @semantic-release/git is backmerged alongside the other commits
await git.fetch(config.repositoryUrl)

// checkout to ensure released branch is up to date with last fetch'ed remote url
await git.checkout(releaseBranch)

const commit = template(config.commit)
Expand Down
7 changes: 0 additions & 7 deletions lib/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,6 @@ export class Git {
await this.exec(["fetch", remote])
}

/**
* @see https://github.com/saitho/semantic-release-backmerge/blob/master/src/helpers/git.ts#L122
*/
public async fetchAllRemotes() {
await this.exec(["config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"])
}

/**
* merge executes a checkout of input 'to' branch, and merges input 'from' branch into 'to'.
* If a merge commit must be done (by default --ff is used), then the merge commit is the input commit.
Expand Down

0 comments on commit a8da0f8

Please sign in to comment.