Commit a80e037a authored by Łukasz Langa's avatar Łukasz Langa
Browse files

Don't over-eagerly make a path absolute if only one passed

If a directory or more than one file is passed, Black nicely shows the relative
paths in output.  Before this change, it showed an absolute path if only
a single file was passed as an argument.  This fixes the inconsistency.
parent 8a82e0bf
Loading
Loading
Loading
Loading
+2 −2
Changes for black.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -342,8 +342,8 @@ def reformat_one(
            cache: Cache = {}
            if write_back != WriteBack.DIFF:
                cache = read_cache(line_length, mode)
                src = src.resolve()
                if src in cache and cache[src] == get_cache_info(src):
                res_src = src.resolve()
                if res_src in cache and cache[res_src] == get_cache_info(res_src):
                    changed = Changed.CACHED
            if changed is not Changed.CACHED and format_file_in_place(
                src,