From: Ɓukasz Langa Date: Fri, 1 Jun 2018 02:47:24 +0000 (-0700) Subject: Don't over-eagerly make a path absolute if only one passed X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/a80e037a9ad5867371d8df0cc8cc9c7520ccc020?ds=sidebyside 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. --- diff --git a/black.py b/black.py index 8ac6d87..da00525 100644 --- a/black.py +++ b/black.py @@ -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,