diff options
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -638,12 +638,17 @@ int copy_reflog_msg(char *buf, const char *msg) int should_autocreate_reflog(const char *refname) { - if (!log_all_ref_updates) + switch (log_all_ref_updates) { + case LOG_REFS_ALWAYS: + return 1; + case LOG_REFS_NORMAL: + return starts_with(refname, "refs/heads/") || + starts_with(refname, "refs/remotes/") || + starts_with(refname, "refs/notes/") || + !strcmp(refname, "HEAD"); + default: return 0; - return starts_with(refname, "refs/heads/") || - starts_with(refname, "refs/remotes/") || - starts_with(refname, "refs/notes/") || - !strcmp(refname, "HEAD"); + } } int is_branch(const char *refname) |