X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-send-pack.c;h=ea1ad6e35f59ef361b40e8f5a54bc9fc9940e59a;hb=eca35a25a92a1ad725af2a549fc9158488c4cc43;hp=bb9c33a6506290edad096acaa52330dd48df6135;hpb=3e08f5db65bcfe3ad238ee0de1cac2da84953cf3;p=git.git diff --git a/builtin-send-pack.c b/builtin-send-pack.c index bb9c33a65..ea1ad6e35 100644 --- a/builtin-send-pack.c +++ b/builtin-send-pack.c @@ -8,7 +8,7 @@ #include "send-pack.h" static const char send_pack_usage[] = -"git-send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=] [--verbose] [--thin] [:] [...]\n" +"git send-pack [--all | --mirror] [--dry-run] [--force] [--receive-pack=] [--verbose] [--thin] [:] [...]\n" " --all and explicit specification are mutually exclusive."; static struct send_pack_args args = { @@ -43,7 +43,7 @@ static int pack_objects(int fd, struct ref *refs) po.out = fd; po.git_cmd = 1; if (start_command(&po)) - die("git-pack-objects failed (%s)", strerror(errno)); + die("git pack-objects failed (%s)", strerror(errno)); /* * We feed the pack-objects we just spawned with revision @@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref) if (args.verbose) fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst); if (ref->deletion) { - if (delete_ref(rs.dst, NULL)) - error("Failed to delete"); + delete_ref(rs.dst, NULL, 0); } else update_ref("update by push", rs.dst, ref->new_sha1, NULL, 0, 0); @@ -537,9 +536,17 @@ static void verify_remote_names(int nr_heads, const char **heads) int i; for (i = 0; i < nr_heads; i++) { + const char *local = heads[i]; const char *remote = strrchr(heads[i], ':'); - remote = remote ? (remote + 1) : heads[i]; + if (*local == '+') + local++; + + /* A matching refspec is okay. */ + if (remote == local && remote[1] == '\0') + continue; + + remote = remote ? (remote + 1) : local; switch (check_ref_format(remote)) { case 0: /* ok */ case CHECK_REF_FORMAT_ONELEVEL: