diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2020-01-13 18:20:13 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@arm.com> | 2020-01-13 18:26:18 +0000 |
commit | b60563a8bf18b5a49431b5913f32f5c5ff8319d9 (patch) | |
tree | 494f6f50c976d3e5d7726620c753f49c5aaaa67e /contrib/git-fetch-vendor.sh | |
parent | 8472660b98a31b32b7d030c2cdc4d41d326364d5 (diff) |
contrib: Add in the default push rule which was overridden
When we add a push rule, the default rule gets removed, so add that in
explicitly. This needs to come last since otherwise it would match
the custom redirecting rules we have for personal and vendor
sub-spaces.
I also noticed that the push rule for the vendor subspace still had
a force push default. We don't want that so remove it.
* gcc-git-customization.sh: Add back the default rule that
is lost by adding a custom push rule.
* git-fetch-vendor.sh: Likewise, also remove '+' from push specs.
Diffstat (limited to 'contrib/git-fetch-vendor.sh')
-rwxr-xr-x | contrib/git-fetch-vendor.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/git-fetch-vendor.sh b/contrib/git-fetch-vendor.sh index 5e1b1f0a854..abb844dbc6a 100755 --- a/contrib/git-fetch-vendor.sh +++ b/contrib/git-fetch-vendor.sh @@ -14,9 +14,13 @@ then exit 1 fi -echo "setting up git to fetch vendor ${vendor} to remotes/${upstream}/${vendor}" +# This entry needs to come last, so unset it now, then reset it after the updates. +git config --unset "remote.${upstream}.push" "refs/heads/\\*:refs/heads/\\*" -git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/heads/*:refs/remotes/${upstream}/${vendor}/*" ":refs/remotes/${upstream}/${vendor}/" +echo "setting up git to fetch vendor ${vendor} to remotes/${upstream}/${vendor}" +git config --replace-all "remote.${upstream}.fetch" "refs/vendors/${vendor}/heads/*:refs/remotes/${upstream}/${vendor}/*" ":refs/remotes/${upstream}/${vendor}/" git config --replace-all "remote.${upstream}.fetch" "+refs/vendors/${vendor}/tags/*:refs/tags/${vendor}/*" ":refs/tags/${vendor}/" -git config --replace-all "remote.${upstream}.push" "+refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*" "^\+refs/heads/${vendor}/" +git config --replace-all "remote.${upstream}.push" "refs/heads/${vendor}/*:refs/vendors/${vendor}/heads/*" "^\+?refs/heads/${vendor}/" +# Re-add the line deleted above. +git config --add "remote.${upstream}.push" "refs/heads/*:refs/heads/*" git fetch |