@@ -14,7 +14,7 @@ export class CommitDragActions {
1414 constructor (
1515 private branchController : BranchController ,
1616 private project : Project ,
17- private branch : BranchStack ,
17+ private stack : BranchStack ,
1818 private commit : DetailedCommit | Commit
1919 ) { }
2020
@@ -33,14 +33,14 @@ export class CommitDragActions {
3333
3434 if (
3535 dropData instanceof HunkDropData &&
36- dropData . branchId === this . branch . id &&
36+ dropData . branchId === this . stack . id &&
3737 dropData . commitId !== this . commit . id &&
3838 ! this . commit . conflicted
3939 ) {
4040 return true ;
4141 } else if (
4242 dropData instanceof FileDropData &&
43- dropData . branchId === this . branch . id &&
43+ dropData . branchId === this . stack . id &&
4444 dropData . commit ?. id !== this . commit . id &&
4545 ! this . commit . conflicted
4646 ) {
@@ -53,18 +53,18 @@ export class CommitDragActions {
5353 onAmend ( dropData : unknown ) : void {
5454 if ( dropData instanceof HunkDropData ) {
5555 const newOwnership = `${ dropData . hunk . filePath } :${ dropData . hunk . id } ` ;
56- this . branchController . amendBranch ( this . branch . id , this . commit . id , newOwnership ) ;
56+ this . branchController . amendBranch ( this . stack . id , this . commit . id , newOwnership ) ;
5757 } else if ( dropData instanceof FileDropData ) {
5858 if ( dropData . file instanceof LocalFile ) {
5959 // this is an uncommitted file change being amended to a previous commit
6060 const newOwnership = filesToOwnership ( dropData . files ) ;
61- this . branchController . amendBranch ( this . branch . id , this . commit . id , newOwnership ) ;
61+ this . branchController . amendBranch ( this . stack . id , this . commit . id , newOwnership ) ;
6262 } else if ( dropData . file instanceof RemoteFile ) {
6363 // this is a file from a commit, rather than an uncommitted file
6464 const newOwnership = filesToSimpleOwnership ( dropData . files ) ;
6565 if ( dropData . commit ) {
6666 this . branchController . moveCommitFile (
67- this . branch . id ,
67+ this . stack . id ,
6868 dropData . commit . id ,
6969 this . commit . id ,
7070 newOwnership
@@ -79,7 +79,7 @@ export class CommitDragActions {
7979 return false ;
8080 }
8181 if ( ! ( dropData instanceof CommitDropData ) ) return false ;
82- if ( dropData . branchId !== this . branch . id ) return false ;
82+ if ( dropData . branchId !== this . stack . id ) return false ;
8383
8484 if ( this . commit . conflicted || dropData . commit . conflicted ) return false ;
8585
@@ -116,7 +116,7 @@ export class CommitDragActionsFactory {
116116 private project : Project
117117 ) { }
118118
119- build ( branch : BranchStack , commit : DetailedCommit | Commit ) {
120- return new CommitDragActions ( this . branchController , this . project , branch , commit ) ;
119+ build ( stack : BranchStack , commit : DetailedCommit | Commit ) {
120+ return new CommitDragActions ( this . branchController , this . project , stack , commit ) ;
121121 }
122122}
0 commit comments