Git fork

Merge branch 'dl/squelch-maybe-uninitialized'

Squelch false-positive compiler warning.

* dl/squelch-maybe-uninitialized:
t/unit-tests/clar: fix -Wmaybe-uninitialized with -Og
remote: bail early from set_head() if missing remote name

+8 -5
+7 -4
builtin/remote.c
··· 1474 }; 1475 argc = parse_options(argc, argv, prefix, options, 1476 builtin_remote_sethead_usage, 0); 1477 - if (argc) { 1478 - strbuf_addf(&b_head, "refs/remotes/%s/HEAD", argv[0]); 1479 - remote = remote_get(argv[0]); 1480 - } 1481 1482 if (!opt_a && !opt_d && argc == 2) { 1483 head_name = xstrdup(argv[1]);
··· 1474 }; 1475 argc = parse_options(argc, argv, prefix, options, 1476 builtin_remote_sethead_usage, 0); 1477 + 1478 + /* All modes require at least a remote name. */ 1479 + if (!argc) 1480 + usage_with_options(builtin_remote_sethead_usage, options); 1481 + 1482 + strbuf_addf(&b_head, "refs/remotes/%s/HEAD", argv[0]); 1483 + remote = remote_get(argv[0]); 1484 1485 if (!opt_a && !opt_d && argc == 2) { 1486 head_name = xstrdup(argv[1]);
+1 -1
t/unit-tests/clar/clar.c
··· 350 clar_run_suite(const struct clar_suite *suite, const char *filter) 351 { 352 const struct clar_func *test = suite->tests; 353 - size_t i, matchlen; 354 struct clar_report *report; 355 int exact = 0; 356
··· 350 clar_run_suite(const struct clar_suite *suite, const char *filter) 351 { 352 const struct clar_func *test = suite->tests; 353 + size_t i, matchlen = 0; 354 struct clar_report *report; 355 int exact = 0; 356