diff --git a/extensions/internal/git/log.go b/extensions/internal/git/log.go index 503ea58b..90978996 100644 --- a/extensions/internal/git/log.go +++ b/extensions/internal/git/log.go @@ -94,6 +94,11 @@ func (tab *gitLogTable) BestIndex(input *sqlite.IndexInfoInput) (*sqlite.IndexIn return nil, sqlite.SQLITE_CONSTRAINT } + // if repository is provided, it must be usable + if idx == 9 && !constraint.Usable { + return nil, sqlite.SQLITE_CONSTRAINT + } + if !constraint.Usable { continue } diff --git a/extensions/internal/git/refs.go b/extensions/internal/git/refs.go index d863fdaf..7217d8ef 100644 --- a/extensions/internal/git/refs.go +++ b/extensions/internal/git/refs.go @@ -55,6 +55,11 @@ func (tab *gitRefTable) BestIndex(input *sqlite.IndexInfoInput) (*sqlite.IndexIn out.ConstraintUsage = make([]*sqlite.ConstraintUsage, len(input.Constraints)) for i, constraint := range input.Constraints { + // if repository is provided, it must be usable + if constraint.ColumnIndex == 6 && !constraint.Usable { + return nil, sqlite.SQLITE_CONSTRAINT + } + if !constraint.Usable { continue // we do not support unusable constraint at all }