diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-26 00:43:32 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-26 00:43:33 (GMT) |
commit | 140045821aa78da3a80a7d7c8f707b955e1ab40d (patch) | |
tree | 9a8bb3c516eb72c8a5141dd3c162e3dc2d34d186 /builtin | |
parent | cadae717d557840d3566b7c0fc2003046e08c88f (diff) | |
parent | 20e416409fc2bc260faf65a0fc74927ed0d3ca12 (diff) | |
download | git-140045821aa78da3a80a7d7c8f707b955e1ab40d.zip git-140045821aa78da3a80a7d7c8f707b955e1ab40d.tar.gz git-140045821aa78da3a80a7d7c8f707b955e1ab40d.tar.bz2 |
Merge branch 'jc/push-delete-nothing'
"git push $there --delete ''" should have been diagnosed as an
error, but instead turned into a matching push, which has been
corrected.
* jc/push-delete-nothing:
push: do not turn --delete '' into a matching push
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/push.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/push.c b/builtin/push.c index 03adb58..194967e 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -115,7 +115,7 @@ static void set_refspecs(const char **refs, int nr, const char *repo) else refspec_appendf(&rs, "refs/tags/%s", ref); } else if (deleterefs) { - if (strchr(ref, ':')) + if (strchr(ref, ':') || !*ref) die(_("--delete only accepts plain target ref names")); refspec_appendf(&rs, ":%s", ref); } else if (!strchr(ref, ':')) { |