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

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

package commit

import (
	git "github.com/libgit2/git2go/v33"
	"gitlab.com/gitlab-org/gitaly/v15/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)
}