summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorChristian Schlack <christian@backhub.co>2020-09-17 15:27:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-17 18:40:17 (GMT)
commit5a07c6c3c2723297f1fbf18e3abcf0cd26e02293 (patch)
treef2661a7825fc0d2bf917531901762c5e2232596c /builtin
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
downloadgit-5a07c6c3c2723297f1fbf18e3abcf0cd26e02293.zip
git-5a07c6c3c2723297f1fbf18e3abcf0cd26e02293.tar.gz
git-5a07c6c3c2723297f1fbf18e3abcf0cd26e02293.tar.bz2
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index e837799..90ab40a 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1355,7 +1355,7 @@ static int set_head(int argc, const char **argv)
result |= error(_("Not a valid ref: %s"), buf2.buf);
else if (create_symref(buf.buf, buf2.buf, "remote set-head"))
result |= error(_("Could not setup %s"), buf.buf);
- if (opt_a)
+ else if (opt_a)
printf("%s/HEAD set to %s\n", argv[0], head_name);
free(head_name);
}