docs/diff-options: clarify scope of diff-filter types
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index da847f6901ba50ba51f793b5b0462c0d268f4046..2d717742d603d1bd7f6c1644c72ed2e2fd5ecb2f 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -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)
@@ -1029,10 +1034,10 @@ static struct string_list *hide_refs;
 
 int parse_hide_refs_config(const char *var, const char *value, const char *section)
 {
+       const char *key;
        if (!strcmp("transfer.hiderefs", var) ||
-           /* NEEDSWORK: use parse_config_key() once both are merged */
-           (starts_with(var, section) && var[strlen(section)] == '.' &&
-            !strcmp(var + strlen(section), ".hiderefs"))) {
+           (!parse_config_key(var, section, NULL, NULL, &key) &&
+            !strcmp(key, "hiderefs"))) {
                char *ref;
                int len;