runemadsen / easygit

Higher level API for git2go
5 stars 3 forks source link

Things to do #1

Open runemadsen opened 7 years ago

runemadsen commented 7 years ago
odewahn commented 7 years ago

On the delete a branch, it should throw an error if there are unmerged commits, unless you explictly pass another variable that confirms it. So, in pseudo code, I want to do something like this:

func deleteBranch( repo string, deleteIfUnmergedCommits bool) {

   # All the stuff to get the branch goes here

   // Do a bunch of stuff to get the branch and figure out if there are any unmerged commits

   if (branchHasUnmergedCommits) {
      if (deleteIfUnmergedCommits) {
         # delete the branch
      } else {
         return errors.New("This branch has unmerged commits")
      }
   } else {
     # delete the branch since there are no unmerged commits
   }
}
odewahn commented 7 years ago

Oh, and one more function I posted into chat, but will make an issue for: