Merge branch 'mh/tidy-ref-update-flags'
[git/git.git] / builtin / checkout.c
index 6c2b4cd..7d8bcc3 100644 (file)
@@ -663,7 +663,7 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
                /* Nothing to do. */
        } else if (opts->force_detach || !new->path) {  /* No longer on any branch. */
                update_ref(msg.buf, "HEAD", &new->commit->object.oid, NULL,
                /* Nothing to do. */
        } else if (opts->force_detach || !new->path) {  /* No longer on any branch. */
                update_ref(msg.buf, "HEAD", &new->commit->object.oid, NULL,
-                          REF_NODEREF, UPDATE_REFS_DIE_ON_ERR);
+                          REF_NO_DEREF, UPDATE_REFS_DIE_ON_ERR);
                if (!opts->quiet) {
                        if (old->path &&
                            advice_detached_head && !opts->force_detach)
                if (!opts->quiet) {
                        if (old->path &&
                            advice_detached_head && !opts->force_detach)