mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-26 00:51:33 -06:00
Merge pull request #6311 from dolthub/pavel/bug-6306
This commit is contained in:
10
go/libraries/doltcore/env/environment.go
vendored
10
go/libraries/doltcore/env/environment.go
vendored
@@ -679,10 +679,16 @@ type repoStateReader struct {
|
||||
}
|
||||
|
||||
func (r *repoStateReader) CWBHeadRef() (ref.DoltRef, error) {
|
||||
if r.RepoState == nil && r.RSLoadErr != nil {
|
||||
return nil, r.RSLoadErr
|
||||
}
|
||||
return r.RepoState.CWBHeadRef(), nil
|
||||
}
|
||||
|
||||
func (r *repoStateReader) CWBHeadSpec() (*doltdb.CommitSpec, error) {
|
||||
if r.RepoState == nil && r.RSLoadErr != nil {
|
||||
return nil, r.RSLoadErr
|
||||
}
|
||||
return r.RepoState.CWBHeadSpec(), nil
|
||||
}
|
||||
|
||||
@@ -695,6 +701,10 @@ type repoStateWriter struct {
|
||||
}
|
||||
|
||||
func (r *repoStateWriter) SetCWBHeadRef(ctx context.Context, marshalableRef ref.MarshalableRef) error {
|
||||
if r.RepoState == nil && r.RSLoadErr != nil {
|
||||
return r.RSLoadErr
|
||||
}
|
||||
|
||||
r.RepoState.Head = marshalableRef
|
||||
err := r.RepoState.Save(r.FS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user