Skip to content

Commit fa245de

Browse files
Copilotdanielsiegl
andcommitted
Fix CI/CD failures: resolve schema file auto-loading issue in smudge operation
Co-authored-by: danielsiegl <41949368+danielsiegl@users.noreply.github.com>
1 parent 33d5400 commit fa245de

3 files changed

Lines changed: 4 additions & 39 deletions

File tree

.gitsqliteschema

Lines changed: 0 additions & 33 deletions
This file was deleted.

internal/filters/smudge.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package filters
22

33
import (
44
"context"
5+
"fmt"
56
"io"
67
"log/slog"
78
"os"
@@ -51,11 +52,8 @@ func Smudge(ctx context.Context, eng *sqlite.Engine, in io.Reader, out io.Writer
5152
return err
5253
}
5354
} else {
54-
slog.Info("Schema file not found, proceeding with data-only restore", "schemaFile", schemaFile)
55-
if err := eng.Restore(ctx, tmpPath, in); err != nil {
56-
slog.Error("SQLite restore failed", "error", err, "duration", logging.FormatDuration(time.Since(restoreStart)))
57-
return err
58-
}
55+
slog.Error("Schema file specified but not found", "schemaFile", schemaFile)
56+
return fmt.Errorf("schema file not found: %s", schemaFile)
5957
}
6058
} else {
6159
// Normal restore without schema file

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func main() {
143143
showHelp = flag.Bool("help", false, "Show help information")
144144
floatPrecision = flag.Int("float-precision", 9, "Number of digits after decimal point for float normalization in INSERT statements")
145145
dataOnly = flag.Bool("data-only", false, "For clean/diff: output only data (INSERT statements), no schema")
146-
schemaFile = flag.String("schema-file", ".gitsqliteschema", "For smudge: read schema from this file instead of stdin")
146+
schemaFile = flag.String("schema-file", "", "For smudge: read schema from this file instead of stdin (default: .gitsqliteschema if file exists)")
147147
schemaOutput = flag.String("schema-output", "", "Save schema to this file during clean/diff (default: do not save schema separately)")
148148
)
149149
flag.Usage = usage

0 commit comments

Comments
 (0)