summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-02-03 11:25:19 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-03 11:25:19 -0800
commitfafca0f72a11bc03263e6f97d07d6f27ea61de48 (patch)
tree0498cf6b916a833d71ac540c4eec85212ee6ac94 /refs
parentMerge branch 'pl/complete-diff-submodule-diff' (diff)
parentdoc: add note about ignoring '--no-create-reflog' (diff)
downloadtgif-fafca0f72a11bc03263e6f97d07d6f27ea61de48.tar.xz
Merge branch 'cw/log-updates-for-all-refs-really'
The "core.logAllRefUpdates" that used to be boolean has been enhanced to take 'always' as well, to record ref updates to refs other than the ones that are expected to be updated (i.e. branches, remote-tracking branches and notes). * cw/log-updates-for-all-refs-really: doc: add note about ignoring '--no-create-reflog' update-ref: add test cases for bare repository refs: add option core.logAllRefUpdates = always config: add markup to core.logAllRefUpdates doc
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c6
-rw-r--r--refs/refs-internal.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8ee2aba39f..c041d4ba21 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2682,7 +2682,7 @@ static int files_rename_ref(struct ref_store *ref_store,
}
flag = log_all_ref_updates;
- log_all_ref_updates = 0;
+ log_all_ref_updates = LOG_REFS_NONE;
if (write_ref_to_lockfile(lock, orig_sha1, &err) ||
commit_ref_update(refs, lock, orig_sha1, NULL, &err)) {
error("unable to write current sha1 into %s: %s", oldrefname, err.buf);
@@ -2835,8 +2835,8 @@ static int log_ref_write_1(const char *refname, const unsigned char *old_sha1,
{
int logfd, result, oflags = O_APPEND | O_WRONLY;
- if (log_all_ref_updates < 0)
- log_all_ref_updates = !is_bare_repository();
+ if (log_all_ref_updates == LOG_REFS_UNSET)
+ log_all_ref_updates = is_bare_repository() ? LOG_REFS_NONE : LOG_REFS_NORMAL;
result = log_ref_setup(refname, logfile, err, flags & REF_FORCE_CREATE_REFLOG);
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 708b26082a..25444cf5b0 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -133,8 +133,6 @@ int verify_refname_available(const char *newname,
*/
int copy_reflog_msg(char *buf, const char *msg);
-int should_autocreate_reflog(const char *refname);
-
/**
* Information needed for a single ref update. Set new_sha1 to the new
* value or to null_sha1 to delete the ref. To check the old value