mirror of
https://github.com/ejwa/gitinspector.git
synced 2025-01-03 11:22:15 +01:00
Fix inconsistent behavior with -f "**" (#95).
Improved by taking advantage of the detected file types during the first pass in the changes module.
This commit is contained in:
parent
139f5306f4
commit
6e0365e8ba
2 changed files with 8 additions and 3 deletions
|
@ -26,7 +26,7 @@ import subprocess
|
||||||
import threading
|
import threading
|
||||||
from .localization import N_
|
from .localization import N_
|
||||||
from .changes import FileDiff
|
from .changes import FileDiff
|
||||||
from . import comment, filtering, format, interval, terminal
|
from . import comment, extensions, filtering, format, interval, terminal
|
||||||
|
|
||||||
NUM_THREADS = multiprocessing.cpu_count()
|
NUM_THREADS = multiprocessing.cpu_count()
|
||||||
|
|
||||||
|
@ -137,11 +137,13 @@ class Blame(object):
|
||||||
row = row.encode("latin-1", "replace")
|
row = row.encode("latin-1", "replace")
|
||||||
row = row.decode("utf-8", "replace").strip("\"").strip("'").strip()
|
row = row.decode("utf-8", "replace").strip("\"").strip("'").strip()
|
||||||
|
|
||||||
if FileDiff.is_valid_extension(row) and not filtering.set_filtered(FileDiff.get_filename(row)):
|
if FileDiff.get_extension(row) in extensions.get_located() and not \
|
||||||
|
filtering.set_filtered(FileDiff.get_filename(row)):
|
||||||
blame_command = filter(None, ["git", "blame", "--line-porcelain", "-w"] + \
|
blame_command = filter(None, ["git", "blame", "--line-porcelain", "-w"] + \
|
||||||
(["-C", "-C", "-M"] if hard else []) +
|
(["-C", "-C", "-M"] if hard else []) +
|
||||||
[interval.get_since(), interval.get_ref(), "--", row])
|
[interval.get_since(), interval.get_ref(), "--", row])
|
||||||
thread = BlameThread(useweeks, changes, blame_command, FileDiff.get_extension(row), self.blames, row.strip())
|
thread = BlameThread(useweeks, changes, blame_command, FileDiff.get_extension(row),
|
||||||
|
self.blames, row.strip())
|
||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
|
|
|
@ -36,3 +36,6 @@ def add_located(string):
|
||||||
__located_extensions__.add("*")
|
__located_extensions__.add("*")
|
||||||
else:
|
else:
|
||||||
__located_extensions__.add(string)
|
__located_extensions__.add(string)
|
||||||
|
|
||||||
|
def get_located():
|
||||||
|
return __located_extensions__
|
||||||
|
|
Loading…
Reference in a new issue