docs/diff-options: clarify scope of diff-filter types
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index cb812455791ab66f2a3d726d5a609726d338dadf..2d717742d603d1bd7f6c1644c72ed2e2fd5ecb2f 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -404,7 +404,7 @@ int refname_match(const char *abbrev_name, const char *full_name)
 static char *substitute_branch_name(const char **string, int *len)
 {
        struct strbuf buf = STRBUF_INIT;
-       int ret = interpret_branch_name(*string, *len, &buf);
+       int ret = interpret_branch_name(*string, *len, &buf, 0);
 
        if (ret == *len) {
                size_t size;
@@ -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)