Allow Dataset HEAD to be set to non-fastforward commits (#2271)

The Dataset.Commit() code pathway still enforces fast-forward-only
behavior, but a new SetHead() method allows the HEAD of a Dataset to
be forced to any other Commit.

noms sync detects the case where the source Commit is not a descendent
of the provided sink Dataset's HEAD and uses the new API to force the
sink to the desired new Commit, printing out the now-abandoned old
HEAD.

Fixes #2240
This commit is contained in:
cmasone-attic
2016-08-05 15:38:41 -07:00
committed by GitHub
parent fd034f8c81
commit 65edbaabe3
11 changed files with 116 additions and 39 deletions
+1 -1
View File
@@ -122,6 +122,6 @@ func IsCommitType(t *types.Type) bool {
return types.IsSubtype(valueCommitType, t)
}
func isRefOfCommitType(t *types.Type) bool {
func IsRefOfCommitType(t *types.Type) bool {
return t.Kind() == types.RefKind && IsCommitType(getRefElementType(t))
}