diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2016-02-09 07:17:26 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-02-09 07:17:26 +0100 |
| commit | f55eca167c2d08045dff929adb8ad8b81d8ccc86 (patch) | |
| tree | 70dfd5c49bc2cbcc4fcdf74ab13ffc9f03bf2767 /tests | |
| parent | 700f0aff24d9b292f24d802c3af3b5c1705193c5 (diff) | |
| download | libgit2-f55eca167c2d08045dff929adb8ad8b81d8ccc86.tar.gz | |
commit: also match the first header field when searchingcmn/header-field-2
We were searching only past the first header field, which meant we were
unable to find e.g. `tree` which is the first field.
While here, make sure to set an error message in case we cannot find the
field.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/commit/parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/commit/parse.c b/tests/commit/parse.c index 388da078a..7c7264bc7 100644 --- a/tests/commit/parse.c +++ b/tests/commit/parse.c @@ -443,6 +443,10 @@ cpxtDQQMGYFpXK/71stq\n\ cl_git_pass(parse_commit(&commit, passing_commit_cases[4])); + cl_git_pass(git_commit_header_field(&buf, commit, "tree")); + cl_assert_equal_s("6b79e22d69bf46e289df0345a14ca059dfc9bdf6", buf.ptr); + git_buf_clear(&buf); + cl_git_pass(git_commit_header_field(&buf, commit, "parent")); cl_assert_equal_s("34734e478d6cf50c27c9d69026d93974d052c454", buf.ptr); git_buf_clear(&buf); |
