Welcome to mirror list, hosted at ThFree Co, Russian Federation.

delete_file.go « commit « gitaly-git2go-v14 « cmd - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8a3ad87070e5b3fe476ab488ef8f4d3bd7b68ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//go:build static && system_libgit2
// +build static,system_libgit2

package commit

import (
	git "github.com/libgit2/git2go/v33"
	"gitlab.com/gitlab-org/gitaly/v14/internal/git2go"
)

func applyDeleteFile(action git2go.DeleteFile, index *git.Index) error {
	if err := validateFileExists(index, action.Path); err != nil {
		return err
	}

	return index.RemoveByPath(action.Path)
}