@@ -751,6 +751,38 @@ public void GetVersion_PathFilterInTwoDeepSubDirAndVersionBump()
751751 Assert . Equal ( 1 , this . GetVersionHeight ( relativeDirectory ) ) ;
752752 }
753753
754+ [ Fact ]
755+ public void GetVersion_PathFilterPlusMerge ( )
756+ {
757+ this . InitializeSourceControl ( withInitialCommit : false ) ;
758+ this . WriteVersionFile ( new VersionOptions
759+ {
760+ Version = new SemanticVersion ( "1.0" ) ,
761+ PathFilters = new FilterPath [ ] { new FilterPath ( "." , string . Empty ) } ,
762+ } ) ;
763+
764+ string conflictedFilePath = Path . Combine ( this . RepoPath , "foo.txt" ) ;
765+
766+ File . WriteAllText ( conflictedFilePath , "foo" ) ;
767+ Commands . Stage ( this . LibGit2Repository , conflictedFilePath ) ;
768+ this . LibGit2Repository . Commit ( "Add foo.txt with foo content." , this . Signer , this . Signer ) ;
769+ Branch originalBranch = this . LibGit2Repository . Head ;
770+
771+ Branch topicBranch = this . LibGit2Repository . Branches . Add ( "topic" , "HEAD~1" ) ;
772+ Commands . Checkout ( this . LibGit2Repository , topicBranch ) ;
773+ File . WriteAllText ( conflictedFilePath , "bar" ) ;
774+ Commands . Stage ( this . LibGit2Repository , conflictedFilePath ) ;
775+ this . LibGit2Repository . Commit ( "Add foo.txt with bar content." , this . Signer , this . Signer ) ;
776+
777+ Commands . Checkout ( this . LibGit2Repository , originalBranch ) ;
778+ MergeResult result = this . LibGit2Repository . Merge ( topicBranch , this . Signer , new MergeOptions { FileConflictStrategy = CheckoutFileConflictStrategy . Ours } ) ;
779+ Assert . Equal ( MergeStatus . Conflicts , result . Status ) ;
780+ Commands . Stage ( this . LibGit2Repository , conflictedFilePath ) ;
781+ this . LibGit2Repository . Commit ( "Merge two branches" , this . Signer , this . Signer ) ;
782+
783+ Assert . Equal ( 3 , this . GetVersionHeight ( ) ) ;
784+ }
785+
754786 [ Fact ]
755787 public void GetVersionHeight_ProjectDirectoryDifferentToVersionJsonDirectory ( )
756788 {
0 commit comments