remote: don't show success message when set-head fails
Suppress the message 'origin/HEAD set to master' in case of an error. $ git remote set-head origin -a error: Not a valid ref: refs/remotes/origin/master origin/HEAD set to master Signed-off-by: Christian Schlack <christian@backhub.co> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Schlack committed
Sep 17, 2020 at 15:27 UTC
5a07c6c3c2723297f1fbf18e3abcf0cd26e02293
1 file changed
+1
-1
builtin/remote.c
+1
-1
@@ -1355,7 +1355,7 @@ static int set_head(int argc, const char **argv)
1355
result |= error(_("Not a valid ref: %s"), buf2.buf);
1356
else if (create_symref(buf.buf, buf2.buf, "remote set-head"))
1357
result |= error(_("Could not setup %s"), buf.buf);
1358
- if (opt_a)
1358
+ else if (opt_a)
1359
printf("%s/HEAD set to %s\n", argv[0], head_name);
1360
free(head_name);
1361
}