File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 22using System . Collections ;
33using System . Collections . Generic ;
44using System . IO ;
5+ using System . Text ;
56using System . Threading . Tasks ;
67
78using Avalonia . Controls ;
@@ -325,10 +326,18 @@ public async Task SquashHeadAsync(Models.Commit head)
325326 {
326327 if ( head . Parents . Count == 1 )
327328 {
328- var message = await new Commands . QueryCommitFullMessage ( _repo . FullPath , head . SHA ) . GetResultAsync ( ) ;
329- var parent = _commits . Find ( x => x . SHA . Equals ( head . Parents [ 0 ] ) ) ;
330- if ( parent != null && _repo . CanCreatePopup ( ) )
331- _repo . ShowPopup ( new Squash ( _repo , parent , message ) ) ;
329+ var parent = await new Commands . QuerySingleCommit ( _repo . FullPath , head . Parents [ 0 ] ) . GetResultAsync ( ) ;
330+ if ( parent == null )
331+ return ;
332+
333+ var headMessage = await new Commands . QueryCommitFullMessage ( _repo . FullPath , head . SHA ) . GetResultAsync ( ) ;
334+ var parentMessage = await new Commands . QueryCommitFullMessage ( _repo . FullPath , head . Parents [ 0 ] ) . GetResultAsync ( ) ;
335+
336+ var builder = new StringBuilder ( ) ;
337+ builder . Append ( parentMessage ) . Append ( "\n \n " ) . Append ( headMessage ) ;
338+
339+ if ( _repo . CanCreatePopup ( ) )
340+ _repo . ShowPopup ( new Squash ( _repo , parent , builder . ToString ( ) ) ) ;
332341 }
333342 }
334343
You can’t perform that action at this time.
0 commit comments