download_file.py: Fix root workspace directory detection
In Gerrit core this was fixed in the change that removed Buck build, but
in Bazlets directory it was missed to be adapted: [1].
[1] https://gerrit-review.googlesource.com/c/gerrit/+/91587
Change-Id: Iffb106d214b82331671b822332c451663b6a30b6
diff --git a/tools/download_file.py b/tools/download_file.py
index 534a6d5..8f790be 100755
--- a/tools/download_file.py
+++ b/tools/download_file.py
@@ -84,9 +84,9 @@
args, _ = opts.parse_args()
root_dir = args.o
-while root_dir and root_dir != "/":
+while root_dir and path.dirname(root_dir) != root_dir:
root_dir, n = path.split(root_dir)
- if n == 'buck-out':
+ if n == 'WORKSPACE':
break
redirects = download_properties(root_dir)