Sync with maint
[gitweb.git] / builtin / receive-pack.c
index 3afe8f80c12904389c4a50aeb32d0b320ff5cec2..e6b93d026478dce208ab4c267d9b6e67fa856c8d 100644 (file)
@@ -117,6 +117,17 @@ static int receive_pack_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
+       if (strcmp(var, "receive.fsck.skiplist") == 0) {
+               const char *path;
+
+               if (git_config_pathname(&path, var, value))
+                       return 1;
+               strbuf_addf(&fsck_msg_types, "%cskiplist=%s",
+                       fsck_msg_types.len ? ',' : '=', path);
+               free((char *)path);
+               return 0;
+       }
+
        if (skip_prefix(var, "receive.fsck.", &var)) {
                if (is_valid_msg_type(var, value))
                        strbuf_addf(&fsck_msg_types, "%c%s=%s",
@@ -922,7 +933,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
                        return "deletion prohibited";
                }
 
-               if (!strcmp(namespaced_name, head_name)) {
+               if (head_name && !strcmp(namespaced_name, head_name)) {
                        switch (deny_delete_current) {
                        case DENY_IGNORE:
                                break;