pre-upload: Use relative file paths for _check_no_long_lines()

Currently, _check_no_long_lines() calls _get_affected_files() without
explicitly specifying "relative=True". Since the default value of
|relative| is False, this results in exclude_regex being compared to the
absolute paths of the affected files, which should be undesirable as it
prevents us from adding an unambiguously unique file/directory to
allowlist using the caret '^' symbol.
This CL solves the issue by simply specifying "relative=True" in
_get_affected_files() called from _check_no_long_lines().
Note that currently there is no PRESUBMIT.cfg that relies on the fact
that long_line_check's exclude_regex is compared against absolute paths,
while there is one that (wrongly) assumes that relative paths are used.

BUG=None
TEST=$ python3 pre-upload_unittest.py

Change-Id: Iab136bea6044686861e7d8a228eb6539671edaa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/2757807
Tested-by: Youkichi Hosoi <youkichihosoi@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Youkichi Hosoi <youkichihosoi@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index 4977e36..0798a98 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -526,7 +526,7 @@
   MAX_LEN = 80
 
   included, excluded = _parse_common_inclusion_options(options)
-  files = _filter_files(_get_affected_files(commit),
+  files = _filter_files(_get_affected_files(commit, relative=True),
                         included + COMMON_INCLUDED_PATHS,
                         excluded + COMMON_EXCLUDED_PATHS + LONG_LINE_OK_PATHS)