diff options
author | Paulo Gomes <paulo.gomes@suse.com> | 2024-03-11 07:40:15 +0000 |
---|---|---|
committer | Paulo Gomes <paulo.gomes@suse.com> | 2024-03-11 07:40:15 +0000 |
commit | d583a76f1c2240283e10949c3593eaa25232e860 (patch) | |
tree | 77dd4152d2f7a8ae370e87bdbba7735e762d36de /options_test.go | |
parent | f3113d2e83ca99face9285a117cb6d93951a7406 (diff) | |
download | go-git-d583a76f1c2240283e10949c3593eaa25232e860.tar.gz |
git: Add commit validation for Reset. Fixes #878
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Diffstat (limited to 'options_test.go')
-rw-r--r-- | options_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/options_test.go b/options_test.go index 171222c..677c317 100644 --- a/options_test.go +++ b/options_test.go @@ -23,6 +23,12 @@ func (s *OptionsSuite) TestCommitOptionsParentsFromHEAD(c *C) { c.Assert(o.Parents, HasLen, 1) } +func (s *OptionsSuite) TestResetOptionsCommitNotFound(c *C) { + o := ResetOptions{Commit: plumbing.NewHash("ab1b15c6f6487b4db16f10d8ec69bb8bf91dcabd")} + err := o.Validate(s.Repository) + c.Assert(err, NotNil) +} + func (s *OptionsSuite) TestCommitOptionsCommitter(c *C) { sig := &object.Signature{} |