gitmergedmaster

package module
v0.0.0-...-ff7e4c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2020 License: MIT Imports: 9 Imported by: 0

README

git-merged-master

Build Status

A helper function that uses the src-d/go-git.v4 library is a determine what branches have already been merged into master in a remote

It iterates through the commits in master, and the head branch of all existing remote branches, and if the head branch of the remote branches matches the commit in master then it is marked as a merged branch:

err = masterCommits.ForEach(func(commit *object.Commit) error {
	for branchName, branchHead := range remoteBranchHeads {
	  if branchHead.String() == commit.Hash.String() {
			log.Infof("Branch %s head (%s) was found in master, so has been merged!\n", branchName, branchHead)
			mergedBranches = append(mergedBranches, branchName)
		}
	}
	return nil
})

Usage

WIP

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL