path: root/builtin/update-ref.c
diff options
authorMichael Haggerty <>2014-04-07 13:48:06 (GMT)
committerJunio C Hamano <>2014-04-07 19:09:13 (GMT)
commit1fbd504942b20a541ba4fcbe90d3ea21b03717e4 (patch)
tree1acd90994d3b2cbb31c4e1d95b5960f8ee7e2a2f /builtin/update-ref.c
parent3afcc4637452100c68b469de7757dd2b45b4d29c (diff)
update-ref --stdin -z: deprecate interpreting the empty string as zeros
In the original version of this command, for the single case of the "update" command's <newvalue>, the empty string was interpreted as being equivalent to 40 "0"s. This shorthand is unnecessary (binary input will usually be generated programmatically anyway), and it complicates the parser and the documentation. So gently deprecate this usage: remove its description from the documentation and emit a warning if it is found. But for reasons of backwards compatibility, continue to accept it. Helped-by: Brad King <> Signed-off-by: Michael Haggerty <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/update-ref.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index c61120f..6f3b909 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -154,6 +154,8 @@ static int parse_next_sha1(struct strbuf *input, const char **next,
goto invalid;
} else if (flags & PARSE_SHA1_ALLOW_EMPTY) {
/* With -z, treat an empty value as all zeros: */
+ warning("%s %s: missing <newvalue>, treating as zero",
+ command, refname);
} else {