gitinspector now finds the absolute path of the git directory.
If gitinspector was not executed standing in the root directory of the git repository (or with a git root specified at the command line), "git ls-tree" would not find all files properly.
This commit is contained in:
parent
9e39bf8ed2
commit
2df9a31b60
|
@ -38,6 +38,7 @@ import os
|
||||||
import optval
|
import optval
|
||||||
import outputable
|
import outputable
|
||||||
import responsibilities
|
import responsibilities
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import terminal
|
import terminal
|
||||||
import timeline
|
import timeline
|
||||||
|
@ -52,7 +53,11 @@ class Runner:
|
||||||
terminal.skip_escapes(not sys.stdout.isatty())
|
terminal.skip_escapes(not sys.stdout.isatty())
|
||||||
terminal.set_stdout_encoding()
|
terminal.set_stdout_encoding()
|
||||||
previous_directory = os.getcwd()
|
previous_directory = os.getcwd()
|
||||||
|
|
||||||
os.chdir(self.repo)
|
os.chdir(self.repo)
|
||||||
|
absolute_path = subprocess.Popen("git rev-parse --show-toplevel", shell=True, bufsize=1,
|
||||||
|
stdout=subprocess.PIPE).stdout
|
||||||
|
os.chdir(absolute_path.readlines()[0].decode("utf-8", "replace").strip())
|
||||||
|
|
||||||
if not format.select(self.opts.format):
|
if not format.select(self.opts.format):
|
||||||
raise format.InvalidFormatError(_("specified output format not supported."))
|
raise format.InvalidFormatError(_("specified output format not supported."))
|
||||||
|
|
Loading…
Reference in New Issue