]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Don't over-eagerly make a path absolute if only one passed
authorŁukasz Langa <lukasz@langa.pl>
Fri, 1 Jun 2018 02:47:24 +0000 (19:47 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Fri, 1 Jun 2018 02:47:24 +0000 (19:47 -0700)
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.

black.py

index 8ac6d87e7c25d35ed4ecde193bf47f6b3a81006b..da00525ca945e6443aa61ffe82a1f93ad0061e71 100644 (file)
--- 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,