diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-11-17 17:55:10 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-11-18 23:39:10 +0000 |
| commit | e226ad8f2fd76211809cf7b381fb55bb600df82f (patch) | |
| tree | f48c25905a7736c59305b5ce2730cf0fe424df25 /tests | |
| parent | 7321cff05df927c8d00755ef21289ec00d125c9c (diff) | |
| download | libgit2-e226ad8f2fd76211809cf7b381fb55bb600df82f.tar.gz | |
refs: add support for core.logAllRefUpdates=always
Since we were not expecting this config entry to contain a string, we
would fail as soon as its (cached) value would be accessed. Hence,
provide some constants for the 4 states we use, and account for "always"
when we decide to reflog changes.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/refs/reflog/reflog.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c index ec251da08..3a6c97c44 100644 --- a/tests/refs/reflog/reflog.c +++ b/tests/refs/reflog/reflog.c @@ -422,6 +422,28 @@ void test_refs_reflog_reflog__logallrefupdates_bare_set_false(void) assert_no_reflog_update(); } +void test_refs_reflog_reflog__logallrefupdates_bare_set_always(void) +{ + git_config *config; + git_reference *ref; + git_reflog *log; + git_oid id; + + cl_git_pass(git_repository_config(&config, g_repo)); + cl_git_pass(git_config_set_string(config, "core.logallrefupdates", "always")); + git_config_free(config); + + git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/bork", &id, 1, "message")); + + cl_git_pass(git_reflog_read(&log, g_repo, "refs/bork")); + cl_assert_equal_i(1, git_reflog_entrycount(log)); + cl_assert_equal_s("message", git_reflog_entry_byindex(log, 0)->msg); + + git_reflog_free(log); + git_reference_free(ref); +} + void test_refs_reflog_reflog__logallrefupdates_bare_unset(void) { git_config *config; |
