Skip to content

Commit 8978166

Browse files
committed
Merge branch 'jh/push-default-upstream-configname'
* jh/push-default-upstream-configname: push.default: Rename 'tracking' to 'upstream'
2 parents fbfeeaf + 53c4031 commit 8978166

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
@@ -1591,7 +1591,8 @@ push.default::
15911591
* `matching` - push all matching branches.
15921592
All branches having the same name in both ends are considered to be
15931593
matching. This is the default.
1594-
* `tracking` - push the current branch to its upstream branch.
1594+
* `upstream` - push the current branch to its upstream branch.
1595+
* `tracking` - deprecated synonym for `upstream`.
15951596
* `current` - push the current branch to a branch of the same name.
15961597

15971598
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
@@ -623,7 +623,7 @@ enum rebase_setup_type {
623623
enum push_default_type {
624624
PUSH_DEFAULT_NOTHING = 0,
625625
PUSH_DEFAULT_MATCHING,
626-
PUSH_DEFAULT_TRACKING,
626+
PUSH_DEFAULT_UPSTREAM,
627627
PUSH_DEFAULT_CURRENT
628628
};
629629

config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,10 @@ static int git_default_push_config(const char *var, const char *value)
737737
push_default = PUSH_DEFAULT_NOTHING;
738738
else if (!strcmp(value, "matching"))
739739
push_default = PUSH_DEFAULT_MATCHING;
740-
else if (!strcmp(value, "tracking"))
741-
push_default = PUSH_DEFAULT_TRACKING;
740+
else if (!strcmp(value, "upstream"))
741+
push_default = PUSH_DEFAULT_UPSTREAM;
742+
else if (!strcmp(value, "tracking")) /* deprecated */
743+
push_default = PUSH_DEFAULT_UPSTREAM;
742744
else if (!strcmp(value, "current"))
743745
push_default = PUSH_DEFAULT_CURRENT;
744746
else {

0 commit comments

Comments
 (0)