Skip to content

Commit bbdc275

Browse files
authored
Merge branch 'main' into redsun82/go-make
2 parents e71d038 + 5c74beb commit bbdc275

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

.github/workflows/buildifier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
extra_args: >
2525
buildifier --all-files 2>&1 ||
2626
(
27-
echo -e "In order to format all bazel files, please run:\n bazel run //:buildifier"; exit 1
27+
echo -e "In order to format all bazel files, please run:\n bazel run //misc/bazel:buildifier"; exit 1
2828
)

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
name: Format bazel files
2727
files: \.(bazel|bzl)
2828
language: system
29-
entry: bazel run //:buildifier
29+
entry: bazel run //misc/bazel:buildifier
3030
pass_filenames: false
3131

3232
- id: go-gen

BUILD.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
2-
3-
buildifier(
4-
name = "buildifier",
5-
exclude_patterns = [
6-
"./.git/*",
7-
],
8-
lint_mode = "fix",
9-
)

misc/bazel/BUILD.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
2+
3+
buildifier(
4+
name = "buildifier",
5+
exclude_patterns = [
6+
"./.git/*",
7+
],
8+
lint_mode = "fix",
9+
)

misc/bazel/internal/git_lfs_probe.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,22 @@ def get_endpoint():
8282

8383
# see https://github.com/git-lfs/git-lfs/blob/310d1b4a7d01e8d9d884447df4635c7a9c7642c2/docs/api/basic-transfers.md
8484
def get_locations(objects):
85+
ret = ["local" for _ in objects]
8586
endpoint = get_endpoint()
8687
indexes = [i for i, o in enumerate(objects) if o]
87-
ret = ["local" for _ in objects]
88+
if not indexes:
89+
# all objects are local, do not send an empty request as that would be an error
90+
return ret
91+
data = {
92+
"operation": "download",
93+
"transfers": ["basic"],
94+
"objects": [objects[i] for i in indexes],
95+
"hash_algo": "sha256",
96+
}
8897
req = urllib.request.Request(
8998
f"{endpoint.href}/objects/batch",
9099
headers=endpoint.headers,
91-
data=json.dumps({
92-
"operation": "download",
93-
"transfers": ["basic"],
94-
"objects": [o for o in objects if o],
95-
"hash_algo": "sha256",
96-
}).encode("ascii"),
100+
data=json.dumps(data).encode("ascii"),
97101
)
98102
with urllib.request.urlopen(req) as resp:
99103
data = json.load(resp)

0 commit comments

Comments
 (0)