ident: use full dns names to generate email addresses
[gitweb.git] / sha1_name.c
index c2fe1aae523cd077000a333febcbb1ce4be27c77..c6331136d19c5224078fa78b6e5e794fcc587fe2 100644 (file)
@@ -861,9 +861,17 @@ int interpret_branch_name(const char *name, struct strbuf *buf)
         * points to something different than a branch.
         */
        if (!upstream)
-               return error("HEAD does not point to a branch");
-       if (!upstream->merge || !upstream->merge[0]->dst)
-               return error("No upstream branch found for '%s'", upstream->name);
+               return error(_("HEAD does not point to a branch"));
+       if (!upstream->merge || !upstream->merge[0]->dst) {
+               if (!ref_exists(upstream->refname))
+                       return error(_("No such branch: '%s'"), cp);
+               if (!upstream->merge)
+                       return error(_("No upstream configured for branch '%s'"),
+                                    upstream->name);
+               return error(
+                       _("Upstream branch '%s' not stored as a remote-tracking branch"),
+                       upstream->merge[0]->src);
+       }
        free(cp);
        cp = shorten_unambiguous_ref(upstream->merge[0]->dst, 0);
        strbuf_reset(buf);