Skip to content

Commit 5a07c6c

Browse files
cschlackgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit 5a07c6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ static int set_head(int argc, const char **argv)
13551355
result |= error(_("Not a valid ref: %s"), buf2.buf);
13561356
else if (create_symref(buf.buf, buf2.buf, "remote set-head"))
13571357
result |= error(_("Could not setup %s"), buf.buf);
1358-
if (opt_a)
1358+
else if (opt_a)
13591359
printf("%s/HEAD set to %s\n", argv[0], head_name);
13601360
free(head_name);
13611361
}

0 commit comments

Comments
 (0)