Skip to content

Commit 61a6f1f

Browse files
committed
Merge branch 'jh/push-default-upstream-configname' into maint
* jh/push-default-upstream-configname: push.default: Rename 'tracking' to 'upstream'
2 parents 7633a5a + 53c4031 commit 61a6f1f

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

Documentation/config.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,8 @@ push.default::
15821582
* `matching` - push all matching branches.
15831583
All branches having the same name in both ends are considered to be
15841584
matching. This is the default.
1585-
* `tracking` - push the current branch to its upstream branch.
1585+
* `upstream` - push the current branch to its upstream branch.
1586+
* `tracking` - deprecated synonym for `upstream`.
15861587
* `current` - push the current branch to a branch of the same name.
15871588

15881589
rebase.stat::

builtin/push.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ static void set_refspecs(const char **refs, int nr)
6464
}
6565
}
6666

67-
static void setup_push_tracking(void)
67+
static void setup_push_upstream(void)
6868
{
6969
struct strbuf refspec = STRBUF_INIT;
7070
struct branch *branch = branch_get(NULL);
7171
if (!branch)
7272
die("You are not currently on a branch.");
7373
if (!branch->merge_nr || !branch->merge)
74-
die("The current branch %s is not tracking anything.",
74+
die("The current branch %s has no upstream branch.",
7575
branch->name);
7676
if (branch->merge_nr != 1)
77-
die("The current branch %s is tracking multiple branches, "
77+
die("The current branch %s has multiple upstream branches, "
7878
"refusing to push.", branch->name);
7979
strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
8080
add_refspec(refspec.buf);
@@ -88,8 +88,8 @@ static void setup_default_push_refspecs(void)
8888
add_refspec(":");
8989
break;
9090

91-
case PUSH_DEFAULT_TRACKING:
92-
setup_push_tracking();
91+
case PUSH_DEFAULT_UPSTREAM:
92+
setup_push_upstream();
9393
break;
9494

9595
case PUSH_DEFAULT_CURRENT:

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ enum rebase_setup_type {
607607
enum push_default_type {
608608
PUSH_DEFAULT_NOTHING = 0,
609609
PUSH_DEFAULT_MATCHING,
610-
PUSH_DEFAULT_TRACKING,
610+
PUSH_DEFAULT_UPSTREAM,
611611
PUSH_DEFAULT_CURRENT
612612
};
613613

config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,10 @@ static int git_default_push_config(const char *var, const char *value)
729729
push_default = PUSH_DEFAULT_NOTHING;
730730
else if (!strcmp(value, "matching"))
731731
push_default = PUSH_DEFAULT_MATCHING;
732-
else if (!strcmp(value, "tracking"))
733-
push_default = PUSH_DEFAULT_TRACKING;
732+
else if (!strcmp(value, "upstream"))
733+
push_default = PUSH_DEFAULT_UPSTREAM;
734+
else if (!strcmp(value, "tracking")) /* deprecated */
735+
push_default = PUSH_DEFAULT_UPSTREAM;
734736
else if (!strcmp(value, "current"))
735737
push_default = PUSH_DEFAULT_CURRENT;
736738
else {

0 commit comments

Comments
 (0)