-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New options to support "simple" centralized workflow #1161
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,9 @@ branch.autoSetupMerge:: | |
automatic setup is done when the starting point is either a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Tao Klerks wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Tao Klerks wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Tao Klerks wrote (reply to this):
|
||
local branch or remote-tracking branch; `inherit` -- if the starting point | ||
has a tracking configuration, it is copied to the new | ||
branch. This option defaults to true. | ||
branch; `simple` -- automatic setup is done only when the starting point | ||
is a remote-tracking branch and the new branch has the same name as the | ||
remote branch. This option defaults to true. | ||
|
||
branch.autoSetupRebase:: | ||
When a new branch is created with 'git branch', 'git switch' or 'git checkout' | ||
|
@@ -38,8 +40,9 @@ branch.<name>.remote:: | |
may be overridden with `remote.pushDefault` (for all branches). | ||
The remote to push to, for the current branch, may be further | ||
overridden by `branch.<name>.pushRemote`. If no remote is | ||
configured, or if you are not on any branch, it defaults to | ||
`origin` for fetching and `remote.pushDefault` for pushing. | ||
configured, or if you are not on any branch and there is more than | ||
one remote defined in the repository, it defaults to `origin` for | ||
fetching and `remote.pushDefault` for pushing. | ||
Additionally, `.` (a period) is the current local repository | ||
(a dot-repository), see `branch.<name>.merge`'s final note below. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -886,6 +886,41 @@ test_expect_success 'branch from tag w/--track causes failure' ' | |
test_must_fail git branch --track my11 foobar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Ævar Arnfjörð Bjarmason wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Eric Sunshine wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Tao Klerks wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Tao Klerks wrote (reply to this):
|
||
' | ||
|
||
test_expect_success 'simple tracking works when remote branch name matches' ' | ||
test_when_finished "rm -rf otherserver" && | ||
git init otherserver && | ||
test_commit -C otherserver my_commit 1 && | ||
git -C otherserver branch feature && | ||
test_config branch.autosetupmerge simple && | ||
test_config remote.otherserver.url otherserver && | ||
test_config remote.otherserver.fetch refs/heads/*:refs/remotes/otherserver/* && | ||
git fetch otherserver && | ||
git branch feature otherserver/feature && | ||
test_cmp_config otherserver branch.feature.remote && | ||
test_cmp_config refs/heads/feature branch.feature.merge | ||
' | ||
|
||
test_expect_success 'simple tracking skips when remote branch name does not match' ' | ||
test_config branch.autosetupmerge simple && | ||
test_config remote.local.url . && | ||
test_config remote.local.fetch refs/heads/*:refs/remotes/local/* && | ||
git fetch local && | ||
git branch my-other local/main && | ||
test_cmp_config "" --default "" branch.my-other.remote && | ||
test_cmp_config "" --default "" branch.my-other.merge | ||
' | ||
|
||
test_expect_success 'simple tracking skips when remote ref is not a branch' ' | ||
test_config branch.autosetupmerge simple && | ||
test_config remote.localtags.url . && | ||
test_config remote.localtags.fetch refs/tags/*:refs/remotes/localtags/* && | ||
git tag mytag12 main && | ||
git fetch localtags && | ||
git branch mytag12 localtags/mytag12 && | ||
test_cmp_config "" --default "" branch.mytag12.remote && | ||
test_cmp_config "" --default "" branch.mytag12.merge | ||
' | ||
|
||
test_expect_success '--set-upstream-to fails on multiple branches' ' | ||
echo "fatal: too many arguments to set new upstream" >expect && | ||
test_must_fail git branch --set-upstream-to main a b c 2>err && | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Junio C Hamano wrote (reply to this):