Commit a1bf26d
fix: handle empty git commit in getDeterministicMtime
When building packages in test fixtures or environments without git,
p.C.Git().Commit can be empty. This caused getDeterministicMtime() to
fail when trying to run 'git show -s --format=%ct ""'.
Solution: Return Unix epoch (0) when commit is empty, providing a
deterministic fallback for test environments while maintaining
deterministic behavior.
This fixes CI test failures in TestBuildDockerDeps and
TestBuildDocker_ExportToCache.
Co-authored-by: Ona <no-reply@ona.com>1 parent 08c2de7 commit a1bf26d
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2401 | 2401 | | |
2402 | 2402 | | |
2403 | 2403 | | |
| 2404 | + | |
2404 | 2405 | | |
2405 | | - | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
2406 | 2413 | | |
2407 | 2414 | | |
2408 | 2415 | | |
2409 | | - | |
| 2416 | + | |
2410 | 2417 | | |
2411 | 2418 | | |
2412 | 2419 | | |
| |||
0 commit comments