@@ -885,10 +885,12 @@ func (ddb *DoltDB) Commit(ctx context.Context, valHash hash.Hash, dref ref.DoltR
885885 return ddb .CommitWithParentSpecs (ctx , valHash , dref , nil , cm )
886886}
887887
888- // FastForwardWithWorkspaceCheck will perform a fast forward update of the branch given to the commit given, but only
889- // if the working set is in sync with the head of the branch given. This is used in the course of pushing to a remote.
890- // If the target doesn't currently have the working set ref, then no working set change will be made.
891- func (ddb * DoltDB ) FastForwardWithWorkspaceCheck (ctx context.Context , branch ref.DoltRef , commit * Commit ) error {
888+ // FastForwardWithWorkspaceCheck performs a fast-forward of |branch| to |commit| only if the remote
889+ // working set is in sync with its HEAD, then updates the working set to match the new HEAD.
890+ // This is used when pushing to a remote. If the remote does not maintain a working set, no working
891+ // set update is performed.
892+ // When |allowDirtyWorking| is true, the working set may have unstaged changes, such as ignored tables.
893+ func (ddb * DoltDB ) FastForwardWithWorkspaceCheck (ctx context.Context , branch ref.DoltRef , commit * Commit , allowDirtyWorking bool ) error {
892894 ds , err := ddb .db .GetDataset (ctx , branch .String ())
893895 if err != nil {
894896 return err
@@ -909,7 +911,7 @@ func (ddb *DoltDB) FastForwardWithWorkspaceCheck(ctx context.Context, branch ref
909911 ws = wsRef .String ()
910912 }
911913
912- _ , err = ddb .db .FastForward (ctx , ds , addr , ws )
914+ _ , err = ddb .db .FastForward (ctx , ds , addr , ws , allowDirtyWorking )
913915
914916 return err
915917}
@@ -931,7 +933,7 @@ func (ddb *DoltDB) FastForwardToHash(ctx context.Context, branch ref.DoltRef, ha
931933 return err
932934 }
933935
934- _ , err = ddb .db .FastForward (ctx , ds , hash , "" )
936+ _ , err = ddb .db .FastForward (ctx , ds , hash , "" , false )
935937
936938 return err
937939}
0 commit comments