change `git_config()` return value to void
[gitweb.git] / builtin / push.c
index 3dd160c6b6a9a6af5010163f86b8a1ac2095dee1..f50e3d5e77db6842ff3450560aad330f6a4bd91d 100644 (file)
@@ -58,7 +58,7 @@ static const char *map_refspec(const char *ref,
        }
 
        if (push_default == PUSH_DEFAULT_UPSTREAM &&
-           !prefixcmp(matched->name, "refs/heads/")) {
+           starts_with(matched->name, "refs/heads/")) {
                struct branch *branch = branch_get(matched->name + 11);
                if (branch->merge_nr == 1 && branch->merge[0]->src) {
                        struct strbuf buf = STRBUF_INIT;
@@ -127,11 +127,10 @@ static NORETURN int die_push_simple(struct branch *branch, struct remote *remote
         * them the big ugly fully qualified ref.
         */
        const char *advice_maybe = "";
-       const char *short_upstream =
-               skip_prefix(branch->merge[0]->src, "refs/heads/");
+       const char *short_upstream = branch->merge[0]->src;
+
+       skip_prefix(short_upstream, "refs/heads/", &short_upstream);
 
-       if (!short_upstream)
-               short_upstream = branch->merge[0]->src;
        /*
         * Don't show advice for people who explicitly set
         * push.default.
@@ -216,7 +215,7 @@ N_("push.default is unset; its implicit value has changed in\n"
    "When push.default is set to 'matching', git will push local branches\n"
    "to the remote branches that already exist with the same name.\n"
    "\n"
-   "In Git 2.0, Git will default to the more conservative 'simple'\n"
+   "Since Git 2.0, Git defaults to the more conservative 'simple'\n"
    "behavior, which only pushes the current branch to the corresponding\n"
    "remote branch that 'git pull' uses to update the current branch.\n"
    "\n"