Skip to content

Commit 7c86c36

Browse files
committed
Less warnings in sync-pr.sh script
Hides warnings for: - Not having a default branch name set - Checking out non-branches
1 parent 8b23a75 commit 7c86c36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/sync-pr.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ isLinear() {
4949
}
5050

5151
step "Fetching nixfmt pull request and creating a branch for the head commit"
52-
git init nixfmt
52+
git init nixfmt -b unused
5353
git -C nixfmt fetch "$nixfmtUrl" "refs/pull/$nixfmtPrNumber/merge"
5454
nixfmtBaseCommit=$(git -C nixfmt rev-parse FETCH_HEAD^1)
5555
nixfmtHeadCommit=$(git -C nixfmt rev-parse FETCH_HEAD^2)
@@ -97,7 +97,7 @@ bodyForCommitIndex() {
9797
}
9898

9999
step "Fetching upstream Nixpkgs commit history"
100-
git init --bare nixpkgs.git
100+
git init --bare nixpkgs.git -b unused
101101

102102
git -C nixpkgs.git remote add upstream "$nixpkgsUpstreamUrl"
103103
# This makes sure that we don't actually have to fetch any contents, otherwise we'd wait forever!
@@ -201,16 +201,16 @@ else
201201
fi
202202

203203

204-
git init nixpkgs
204+
git init nixpkgs -b unused
205205
git -C nixpkgs config user.name "GitHub Actions"
206206
git -C nixpkgs config user.email "[email protected]"
207207

208208
step "Fetching contents of Nixpkgs base commit $nixpkgsBaseCommit"
209209
# This is needed because for every commit we reset Nixpkgs to the base branch before formatting
210-
git -C nixpkgs fetch --no-tags --depth 1 "$nixpkgsUpstreamUrl" "$nixpkgsBaseCommit"
210+
git -C nixpkgs fetch --no-tags --depth 1 "$nixpkgsUpstreamUrl" "$nixpkgsBaseCommit":base
211211

212212
step "Checking out Nixpkgs at the base commit"
213-
git -C nixpkgs checkout "$nixpkgsBaseCommit"
213+
git -C nixpkgs checkout base
214214

215215
# Because we run the formatter in a Nix derivation, we need to get its input files into the Nix store.
216216
# Since they never change, it would be wasteful to import them multiple times for each nixfmt run.
@@ -257,7 +257,7 @@ next() {
257257
update "$index"
258258

259259
step "Checking out Nixpkgs at the base commit"
260-
git -C nixpkgs checkout "$nixpkgsBaseCommit" -- .
260+
git -C nixpkgs checkout base -- .
261261

262262
step "Running nixfmt on nixpkgs in a derivation"
263263

0 commit comments

Comments
 (0)