Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,28 @@ or a repository-scoped LFS object already uploaded and verified through the LFS

`blobSha` and `lfs` are mutually exclusive. `executable` is optional for puts. A `delete` operation takes only `op` and `path`.

A `move` relocates a file or a whole directory tree:

```json
{
"op": "move",
"fromPath": "plugins",
"path": "server/plugins"
}
```

Operations are applied in array order. After the move, later operations in the same request use the destination path:

```json
{
"operations": [
{ "op": "move", "fromPath": "plugins", "path": "server/plugins" },
{ "op": "put", "path": "server/plugins/config.yml", "blobSha": "<sha>" },
{ "op": "delete", "path": "server/plugins/something.yaml" }
]
}
```

`expectedHeadSha` controls concurrency:

| Value | Meaning |
Expand Down
1 change: 1 addition & 0 deletions internal/domain/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type CommitFileLfsObject struct {

type CommitFileOp struct {
Delete bool
MoveFrom string
Path string
BlobSHA *string
Lfs *CommitFileLfsObject
Expand Down
2 changes: 1 addition & 1 deletion internal/gitbackend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ type Backend interface {
StatBlob(ctx context.Context, storagePath, rev, treePath string) (BlobInfo, error)
ReadBlob(ctx context.Context, storagePath, blobSHA string, out io.Writer) error
WriteBlob(ctx context.Context, storagePath string, r io.Reader) (string, int64, error)
ApplyCommit(ctx context.Context, storagePath string, spec CommitSpec, ops []CommitOp, clean CleanFunc) (RefChange, error)
ApplyCommit(ctx context.Context, storagePath string, spec CommitSpec, ops []CommitOp, clean CleanFunc, checkWrite CheckWriteFunc) (RefChange, error)
GC(ctx context.Context, storagePath string) error
}
1 change: 1 addition & 0 deletions internal/gitbackend/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var (
ErrInvalidPath = errors.New("invalid tree path")
ErrRevNotFound = errors.New("revision not found")
ErrPathNotFound = errors.New("path not found in tree")
ErrPathExists = errors.New("path already exists in tree")
ErrNotABlob = errors.New("path is not a blob")

// commit creation
Expand Down
Loading
Loading