summaryrefslogtreecommitdiff
path: root/git/index
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-09-29 01:07:41 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-09-29 01:46:15 +0200
commit395955609dfd711cc4558e2b618450f3514b28c1 (patch)
tree9ee15a36cbc05f9b509aedbda2373cfc0ace2d17 /git/index
parentf1d2d0683afa6328b6015c6a3aa6a6912a055756 (diff)
downloadgitpython-395955609dfd711cc4558e2b618450f3514b28c1.tar.gz
FIX hook TC on PY3+Win & indeterministic lock timing.
+ Cannot `index.path` into ENV, it is bytes! + The hook TC never runs on linux! + Unblock removal of odbfile in perf-large streams TC. + Attempt to unblock removal of submodule file by intensive cleaning. more unblock files
Diffstat (limited to 'git/index')
-rw-r--r--git/index/fun.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git/index/fun.py b/git/index/fun.py
index 0179625a..74ac929e 100644
--- a/git/index/fun.py
+++ b/git/index/fun.py
@@ -41,10 +41,13 @@ from .util import (
from gitdb.base import IStream
from gitdb.typ import str_tree_type
from git.compat import (
+ PY3,
defenc,
force_text,
force_bytes,
is_posix,
+ safe_encode,
+ safe_decode,
)
S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule
@@ -69,7 +72,7 @@ def run_commit_hook(name, index):
return
env = os.environ.copy()
- env['GIT_INDEX_FILE'] = index.path
+ env['GIT_INDEX_FILE'] = safe_decode(index.path) if PY3 else safe_encode(index.path)
env['GIT_EDITOR'] = ':'
try:
cmd = subprocess.Popen(hp,