Code

Merge branch 'jl/submodule-add-noname'
[git.git] / http-push.c
index 8cc8ee0dfd5c047b2523f63346bf9b30094c1386..ad1a6c90967b36365563de210ec2d066ae9d979a 100644 (file)
@@ -193,6 +193,8 @@ static char *xml_entities(char *s)
                case '&':
                        strbuf_addstr(&buf, "&");
                        break;
+               case 0:
+                       return strbuf_detach(&buf, NULL);
                }
                s++;
        }
@@ -1790,8 +1792,6 @@ int main(int argc, char **argv)
 
        git_extract_argv0_path(argv[0]);
 
-       setup_git_directory();
-
        repo = xcalloc(sizeof(*repo), 1);
 
        argv++;
@@ -1825,6 +1825,8 @@ int main(int argc, char **argv)
                                force_delete = 1;
                                continue;
                        }
+                       if (!strcmp(arg, "-h"))
+                               usage(http_push_usage);
                }
                if (!repo->url) {
                        char *path = strstr(arg, "//");
@@ -1852,6 +1854,8 @@ int main(int argc, char **argv)
        if (delete_branch && nr_refspec != 1)
                die("You must specify only one branch name when deleting a remote branch");
 
+       setup_git_directory();
+
        memset(remote_dir_exists, -1, 256);
 
        /*