@@ -60,9 +60,9 @@ function(name, commit, force, signature, logMessage) {
6060 * @return {Ref }
6161 */
6262Repository . prototype . getBranch = function ( name , callback ) {
63- name = name instanceof Reference || ~ name . indexOf ( "refs/heads/" )
64- ? name
65- : "refs/heads/" + name ;
63+ name = ( name instanceof Reference ||
64+ ~ name . indexOf ( "refs/heads/" ) ) ? name
65+ : "refs/heads/" + name ;
6666
6767 return this . getReference ( name ) . then ( function ( reference ) {
6868 if ( typeof callback === "function" ) {
@@ -531,11 +531,13 @@ Repository.prototype.fetchAll = function() {
531531 * @return {Oid|Index } A commit id for a succesful merge or an index for a
532532 * merge with conflicts
533533 */
534- Repository . prototype . mergeBranches = function ( to , from ) {
534+ Repository . prototype . mergeBranches = function ( to , from , signature ) {
535535 var repo = this ;
536536 var fromBranch ;
537537 var toBranch ;
538538
539+ signature = signature || repo . defaultSignature ( ) ;
540+
539541 return Promise . all ( [
540542 repo . getBranch ( to ) ,
541543 repo . getBranch ( from )
@@ -568,7 +570,7 @@ Repository.prototype.mergeBranches = function(to, from) {
568570
569571 return toBranch . setTarget (
570572 fromCommitOid ,
571- repo . defaultSignature ( ) ,
573+ signature ,
572574 message )
573575 . then ( function ( ) {
574576 return fromCommitOid ;
@@ -593,12 +595,11 @@ Repository.prototype.mergeBranches = function(to, from) {
593595 " into " +
594596 toBranch . shorthand ( ) ;
595597 console . log ( message ) ;
596- var sig = repo . defaultSignature ( ) ;
597598
598599 return repo . createCommit (
599600 toBranch . name ( ) ,
600- sig ,
601- sig ,
601+ signature ,
602+ signature ,
602603 message ,
603604 oid ,
604605 [ toCommitOid , fromCommitOid ] ) ;
0 commit comments