From 27f8690db999f6e56f0af7a9ea3d28a019ed72ca Mon Sep 17 00:00:00 2001
From: Fumitoshi Ukai <ukai@google.com>
Date: Tue, 30 Jun 2026 18:32:03 -0700
Subject: [PATCH] don't depends on histograms.xml if it is not git checkout

histograms.xml is only generated on git checkout.

Bug: 329080012
Change-Id: Iea4484f8af4cf9ef25e25ea1df2c616fbe46ed5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8019063
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Cr-Commit-Position: refs/heads/main@{#1655184}
---
 tools/metrics/BUILD.gn | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/metrics/BUILD.gn b/tools/metrics/BUILD.gn
index c826e9708bf6a6..23799c76dd7ef1 100644
--- a/tools/metrics/BUILD.gn
+++ b/tools/metrics/BUILD.gn
@@ -41,11 +41,11 @@ group("metrics_metadata") {
   ]
 
   # Only include histograms_xml if we have access to dirmd data, which
-  # is used to populate ownership information. This is only set to false
-  # for non-git checkouts.
-  # TODO(crbug.com/329080012): Remove this once dirmd works in non-git
-  # checkouts.
-  if (generate_location_tags) {
+  # is used to populate ownership information. This is disabled
+  # for non-git checkouts, as dirmd doesn't work on non-git checkout.
+  # TODO(crbug.com/329080012): Remove this condition once dirmd works
+  # in non-git checkouts.
+  if (path_exists("//.git")) {
     deps += [ ":histograms_xml" ]
   }
 }
