Skip to content

Commit 242dbba

Browse files
Change config key to status.compareBranch
Update from repo.settings.statusGoalBranch to follow standard git config pattern status.compareBranch. Signed-off-by: Harald Nordgren <[email protected]>
1 parent 4416789 commit 242dbba

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

remote.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,15 +2246,15 @@ static char *get_goal_branch_ref(char **full_ref_out)
22462246
char *slash_pos;
22472247
char *ret = NULL;
22482248

2249-
if (repo_config_get_value(the_repository, "repo.settings.statusGoalBranch", &config_value))
2249+
if (repo_config_get_value(the_repository, "status.goalBranch", &config_value))
22502250
return NULL;
22512251

22522252
if (!config_value || !*config_value)
22532253
return NULL;
22542254

22552255
slash_pos = strchr(config_value, '/');
22562256
if (!slash_pos || slash_pos == config_value || !slash_pos[1]) {
2257-
warning(_("invalid value for repo.settings.statusGoalBranch: '%s' (expected format: remote/branch)"),
2257+
warning(_("invalid value for status.goalBranch: '%s' (expected format: remote/branch)"),
22582258
config_value);
22592259
return NULL;
22602260
}

t/t6040-tracking-info.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ test_expect_success 'status shows ahead of both tracked branch and origin/main'
309309
(
310310
cd test &&
311311
git checkout work >/dev/null &&
312-
git config repo.settings.statusGoalBranch origin/main &&
312+
git config status.goalBranch origin/main &&
313313
git status --long -b
314314
) >actual &&
315315
cat >expect <<-\EOF &&
@@ -328,7 +328,7 @@ test_expect_success 'checkout shows ahead of both tracked branch and origin/main
328328
(
329329
cd test &&
330330
git checkout main >/dev/null &&
331-
git config repo.settings.statusGoalBranch origin/main &&
331+
git config status.goalBranch origin/main &&
332332
git checkout work 2>&1
333333
) >actual &&
334334
cat >expect <<-\EOF &&
@@ -370,7 +370,7 @@ test_expect_success 'status shows ahead of tracked and diverged from origin/main
370370
(
371371
cd test &&
372372
git checkout work2 >/dev/null &&
373-
git config repo.settings.statusGoalBranch origin/main &&
373+
git config status.goalBranch origin/main &&
374374
git status --long -b
375375
) >actual &&
376376
cat >expect <<-\EOF &&
@@ -402,7 +402,7 @@ test_expect_success 'status shows diverged from tracked and behind origin/main'
402402
(
403403
cd test &&
404404
git checkout work2b >/dev/null &&
405-
git config repo.settings.statusGoalBranch origin/main &&
405+
git config status.goalBranch origin/main &&
406406
git status --long -b
407407
) >actual &&
408408
cat >expect <<-\EOF &&
@@ -437,7 +437,7 @@ test_expect_success 'status shows behind tracked and ahead of origin/main' '
437437
(
438438
cd test &&
439439
git checkout work3 >/dev/null &&
440-
git config repo.settings.statusGoalBranch origin/main &&
440+
git config status.goalBranch origin/main &&
441441
git status --long -b
442442
) >actual &&
443443
cat >expect <<-\EOF &&
@@ -465,7 +465,7 @@ test_expect_success 'status prefers upstream remote over origin for comparison'
465465
(
466466
cd test &&
467467
git checkout work >/dev/null &&
468-
git config repo.settings.statusGoalBranch upstream/main &&
468+
git config status.goalBranch upstream/main &&
469469
git status --long -b
470470
) >actual &&
471471
cat >expect <<-\EOF &&
@@ -495,7 +495,7 @@ test_expect_success 'status shows up to date with tracked but diverged from defa
495495
(
496496
cd test &&
497497
git checkout synced_feature >/dev/null &&
498-
git config repo.settings.statusGoalBranch upstream/main &&
498+
git config status.goalBranch upstream/main &&
499499
git status --long -b
500500
) >actual &&
501501
cat >expect <<-\EOF &&
@@ -525,7 +525,7 @@ test_expect_success 'status shows up to date with tracked but diverged from orig
525525
(
526526
cd test &&
527527
git checkout synced_feature2 >/dev/null &&
528-
git config repo.settings.statusGoalBranch origin/main &&
528+
git config status.goalBranch origin/main &&
529529
git status --long -b
530530
) >actual &&
531531
cat >expect <<-\EOF &&
@@ -551,7 +551,7 @@ test_expect_success 'status shows up to date with tracked but shows default bran
551551
(
552552
cd test &&
553553
git checkout synced_feature3 >/dev/null &&
554-
git config repo.settings.statusGoalBranch origin/main &&
554+
git config status.goalBranch origin/main &&
555555
git status --long -b
556556
) >actual &&
557557
cat >expect <<-\EOF &&
@@ -565,11 +565,11 @@ EOF
565565
test_cmp expect actual
566566
'
567567

568-
test_expect_success 'status with repo.settings.statusGoalBranch unset shows no default comparison' '
568+
test_expect_success 'status with status.goalBranch unset shows no default comparison' '
569569
(
570570
cd test &&
571571
git checkout synced_feature3 >/dev/null &&
572-
git config --unset repo.settings.statusGoalBranch 2>/dev/null || true &&
572+
git config --unset status.goalBranch 2>/dev/null || true &&
573573
git status --long -b
574574
) >actual &&
575575
cat >expect <<-\EOF &&
@@ -581,11 +581,11 @@ EOF
581581
test_cmp expect actual
582582
'
583583

584-
test_expect_success 'status with repo.settings.statusGoalBranch set uses configured branch' '
584+
test_expect_success 'status with status.goalBranch set uses configured branch' '
585585
(
586586
cd test &&
587587
git checkout synced_feature3 >/dev/null &&
588-
git config repo.settings.statusGoalBranch origin/main &&
588+
git config status.goalBranch origin/main &&
589589
git status --long -b
590590
) >actual &&
591591
cat >expect <<-\EOF &&
@@ -599,11 +599,11 @@ EOF
599599
test_cmp expect actual
600600
'
601601

602-
test_expect_success 'status with repo.settings.statusGoalBranch set to different remote/branch' '
602+
test_expect_success 'status with status.goalBranch set to different remote/branch' '
603603
(
604604
cd test &&
605605
git checkout work >/dev/null &&
606-
git config repo.settings.statusGoalBranch origin/feature &&
606+
git config status.goalBranch origin/feature &&
607607
git status --long -b
608608
) >actual &&
609609
cat >expect <<-\EOF &&
@@ -616,11 +616,11 @@ EOF
616616
test_cmp expect actual
617617
'
618618

619-
test_expect_success 'status with repo.settings.statusGoalBranch set to non-existent branch' '
619+
test_expect_success 'status with status.goalBranch set to non-existent branch' '
620620
(
621621
cd test &&
622622
git checkout synced_feature3 >/dev/null &&
623-
git config repo.settings.statusGoalBranch origin/nonexistent &&
623+
git config status.goalBranch origin/nonexistent &&
624624
git status --long -b
625625
) >actual &&
626626
cat >expect <<-\EOF &&

0 commit comments

Comments
 (0)