Skip to content

Commit a38a005

Browse files
committed
Added imports for standard locking file classes into the git module
1 parent 697702e commit a38a005

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

TODO

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ Object
3232

3333
Config
3434
------
35-
* Expand .get* methods of GitConfigParser to support default value. If it is not None,
36-
it will be returned instead of raising. This way the class will be much more usable,
37-
and ... I truly hate this config reader as it is so 'old' style. Its not even a new-style
38-
class yet showing that it must be ten years old.
39-
- If you are at it, why not start a new project that reimplements the ConfigWriter
40-
properly, honestly. Tune it for usability ... .
35+
* Cache the config_reader of the repository and check whether they need to
36+
update their information as the local file(s) have changed. Currently
37+
we re-read all configuration data each time a config-reader is created.
38+
In a way this leaves it to the user to actually keep the config-reader for
39+
multiple uses, but there are cases when the user can hardly do that.
4140

4241
Diff
4342
----

lib/git/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from git.stats import Stats
2121
from git.remote import *
2222
from git.index import *
23+
from git.utils import LockFile, BlockingLockFile
2324

2425
__all__ = [ name for name, obj in locals().items()
2526
if not (name.startswith('_') or inspect.ismodule(obj)) ]

lib/git/cmd.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ def execute(self, command,
218218

219219
# Wait for the process to return
220220
status = 0
221+
stdout_value = ''
222+
stderr_value = ''
221223
try:
222224
if output_stream is None:
223225
stdout_value = proc.stdout.read().rstrip() # strip trailing "\n"
@@ -232,6 +234,7 @@ def execute(self, command,
232234
stdout_value = output_stream
233235
# END stdout handling
234236
stderr_value = proc.stderr.read().rstrip() # strip trailing "\n"
237+
235238
# waiting here should do nothing as we have finished stream reading
236239
status = proc.wait()
237240
finally:

lib/git/index.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from errors import GitCommandError
2323
from git.objects import Blob, Tree, Object, Commit
24-
from git.utils import SHA1Writer, LazyMixin, ConcurrentWriteOperation, join_path_native, BlockingLockFile
24+
from git.utils import SHA1Writer, LazyMixin, ConcurrentWriteOperation, join_path_native
2525

2626

2727
class CheckoutError( Exception ):
@@ -914,6 +914,7 @@ def add(self, items, force=True, fprogress=lambda *args: None):
914914
entries_added = list()
915915
paths, entries = self._preprocess_add_items(items)
916916

917+
917918
# HANDLE PATHS
918919
if paths:
919920
# to get suitable progress information, pipe paths to stdin

lib/git/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, config, section):
2929

3030
def __getattr__(self, attr):
3131
if attr in self._valid_attrs_:
32-
return lambda *args: self._call_config(attr, *args)
32+
return lambda *args, **kwargs: self._call_config(attr, *args, **kwargs)
3333
return super(_SectionConstraint,self).__getattribute__(attr)
3434

3535
def _call_config(self, method, *args, **kwargs):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy