summaryrefslogtreecommitdiff
path: root/gitdb/db
diff options
context:
space:
mode:
Diffstat (limited to 'gitdb/db')
-rw-r--r--gitdb/db/loose.py7
-rw-r--r--gitdb/db/pack.py4
2 files changed, 6 insertions, 5 deletions
diff --git a/gitdb/db/loose.py b/gitdb/db/loose.py
index 374cdc7..1338e83 100644
--- a/gitdb/db/loose.py
+++ b/gitdb/db/loose.py
@@ -40,7 +40,8 @@ from gitdb.util import (
rename,
dirname,
basename,
- join
+ join,
+ is_win,
)
from gitdb.fun import (
@@ -71,7 +72,7 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
# On windows we need to keep it writable, otherwise it cannot be removed
# either
new_objects_mode = int("444", 8)
- if os.name == 'nt':
+ if is_win:
new_objects_mode = int("644", 8)
def __init__(self, root_path):
@@ -226,7 +227,7 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW):
mkdir(obj_dir)
# END handle destination directory
# rename onto existing doesn't work on windows
- if os.name == 'nt':
+ if is_win:
if isfile(obj_path):
remove(tmp_path)
else:
diff --git a/gitdb/db/pack.py b/gitdb/db/pack.py
index 4834caf..95eb564 100644
--- a/gitdb/db/pack.py
+++ b/gitdb/db/pack.py
@@ -43,13 +43,13 @@ class PackedDB(FileDBBase, ObjectDBR, CachingDB, LazyMixin):
# * hits - number of times the pack was hit with a request
# * entity - Pack entity instance
# * sha_to_index - PackIndexFile.sha_to_index method for direct cache query
- # self._entities = list() # lazy loaded list
+ # self._entities = [] # lazy loaded list
self._hit_count = 0 # amount of hits
self._st_mtime = 0 # last modification data of our root path
def _set_cache_(self, attr):
if attr == '_entities':
- self._entities = list()
+ self._entities = []
self.update_cache(force=True)
# END handle entities initialization