regex: use regexec_buf()
[gitweb.git] / builtin / checkout.c
index d53ab75ac9a078c821ed5112643ee896fed35a88..efcbd8f6b5e0b7d551c88c02b6d7d3069a47944d 100644 (file)
@@ -661,7 +661,8 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
                        describe_detached_head(_("HEAD is now at"), new->commit);
                }
        } else if (new->path) { /* Switch branches. */
-               create_symref("HEAD", new->path, msg.buf);
+               if (create_symref("HEAD", new->path, msg.buf) < 0)
+                       die(_("unable to update HEAD"));
                if (!opts->quiet) {
                        if (old->path && !strcmp(new->path, old->path)) {
                                if (opts->new_branch_force)