@@ -11,6 +11,7 @@ define(function (require, exports) {
1111 FileSystem = brackets . getModule ( "filesystem/FileSystem" ) ,
1212 Menus = brackets . getModule ( "command/Menus" ) ,
1313 PopUpManager = brackets . getModule ( "widgets/PopUpManager" ) ,
14+ StringUtils = brackets . getModule ( "utils/StringUtils" ) ,
1415 SidebarView = brackets . getModule ( "project/SidebarView" ) ;
1516
1617 var Git = require ( "src/Git/Git" ) ,
@@ -164,9 +165,24 @@ define(function (require, exports) {
164165 } ) . on ( "mouseleave" , "a" , function ( ) {
165166 $ ( this ) . removeClass ( "selected" ) ;
166167 } ) . on ( "click" , "a.git-branch-link .trash-icon" , function ( ) {
167- Main . gitControl . deleteLocalBranch ( $ ( this ) . parent ( ) . data ( "branch" ) ) . catch ( function ( err ) {
168- ErrorHandler . showError ( err , "Branch deletion failed" ) ;
168+ var branchName = $ ( this ) . parent ( ) . data ( "branch" ) ;
169+ Utils . askQuestion (
170+ Strings . DELETE_LOCAL_BRANCH ,
171+ StringUtils . format ( Strings . DELETE_LOCAL_BRANCH_NAME , branchName ) ,
172+ { booleanResponse : true }
173+ )
174+ . then ( function ( response ) {
175+ if ( response === true ) {
176+ return Main . gitControl . deleteLocalBranch ( branchName ) . catch ( function ( err ) {
177+ ErrorHandler . showError ( err , "Branch deletion failed" ) ;
178+ } ) ;
179+ }
180+ } )
181+ . catch ( function ( err ) {
182+ ErrorHandler . logError ( err ) ;
169183 } ) ;
184+
185+
170186 } ) . on ( "click" , ".merge-branch" , function ( ) {
171187 var fromBranch = $ ( this ) . parent ( ) . data ( "branch" ) ;
172188 doMerge ( fromBranch ) ;
0 commit comments