Skip to content

Commit

Permalink
fix(api history): need to use new repo.CanonicalizeDatasetRef functio…
Browse files Browse the repository at this point in the history
…n to get correct ref to pass to history
  • Loading branch information
ramfox committed Feb 15, 2018
1 parent 2be9d66 commit 4ee7ab1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (d *HistoryRequests) Log(params *LogParams, res *[]repo.DatasetRef) (err er
}

ref := params.Ref
err = repo.CanonicalizeDatasetRef(d.repo, &ref)
if err != nil {
return err
}
if ref.Path == "" && (ref.Name == "" && ref.Peername == "") {
return fmt.Errorf("either path or peername/name is required")
}
Expand Down Expand Up @@ -86,11 +90,7 @@ func (d *HistoryRequests) Log(params *LogParams, res *[]repo.DatasetRef) (err er
if limit == 0 || ref.Dataset.PreviousPath == "" {
break
}

ref, err = repo.ParseDatasetRef(ref.Dataset.PreviousPath)
if err != nil {
return fmt.Errorf("error adding datasets to log: %s", err.Error())
}
ref.Path = ref.Dataset.PreviousPath
}

*res = log
Expand Down

0 comments on commit 4ee7ab1

Please sign in to comment.