]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-branch.c
Merge branch 'maint-1.6.0' into maint-1.6.1
[git.git] / builtin-branch.c
index 02fa38fd3b13b5c17aa23edbfd79f91a052adf76..7c615871100aa8c9e637bde41197419bfb04d68a 100644 (file)
@@ -165,7 +165,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
                        ret = 1;
                } else {
                        struct strbuf buf = STRBUF_INIT;
-                       printf("Deleted %sbranch %s (%s).\n", remote, argv[i],
+                       printf("Deleted %sbranch %s (was %s).\n", remote, argv[i],
                                find_unique_abbrev(sha1, DEFAULT_ABBREV));
                        strbuf_addf(&buf, "branch.%s", argv[i]);
                        if (git_config_rename_section(buf.buf, NULL) < 0)
@@ -583,10 +583,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                rename_branch(head, argv[0], rename > 1);
        else if (rename && (argc == 2))
                rename_branch(argv[0], argv[1], rename > 1);
-       else if (argc <= 2)
+       else if (argc <= 2) {
+               if (kinds != REF_LOCAL_BRANCH)
+                       die("-a and -r options to 'git branch' do not make sense with a branch name");
                create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
                              force_create, reflog, track);
-       else
+       else
                usage_with_options(builtin_branch_usage, options);
 
        return 0;