Allow explicit publication stores in Git metadata
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package publish
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
@@ -12,6 +13,8 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.maximumdirect.net/releasekit/internal/git"
|
||||
)
|
||||
|
||||
const recordFormatVersion = 1
|
||||
@@ -148,6 +151,16 @@ func rejectUnignoredWorktreePath(repositoryDir, root, proposed string) error {
|
||||
if err != nil || rel == ".." || strings.HasPrefix(rel, ".."+string(filepath.Separator)) {
|
||||
return nil
|
||||
}
|
||||
metadata, err := git.MetadataDirectories(context.Background(), repositoryDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, directory := range metadata {
|
||||
rel, err := filepath.Rel(directory, actual)
|
||||
if err == nil && rel != ".." && !strings.HasPrefix(rel, ".."+string(filepath.Separator)) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
cmd := exec.Command("git", "-C", repositoryDir, "check-ignore", "-q", "--", actual)
|
||||
err = cmd.Run()
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user