Skip to content

Fix top-of-file license URLs here in gitdb too #96

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Initialize the object database module"""

import sys
2 changes: 1 addition & 1 deletion gitdb/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Module with basic data structures - they are designed to be lightweight and fast"""
from gitdb.util import bin_to_hex

2 changes: 1 addition & 1 deletion gitdb/db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/

from gitdb.db.base import *
from gitdb.db.loose import *
2 changes: 1 addition & 1 deletion gitdb/db/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Contains implementations of database retrieveing objects"""
from gitdb.util import (
join,
2 changes: 1 addition & 1 deletion gitdb/db/git.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.db.base import (
CompoundDB,
ObjectDBW,
2 changes: 1 addition & 1 deletion gitdb/db/loose.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.db.base import (
FileDBBase,
ObjectDBR,
2 changes: 1 addition & 1 deletion gitdb/db/mem.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Contains the MemoryDatabase implementation"""
from gitdb.db.loose import LooseObjectDB
from gitdb.db.base import (
2 changes: 1 addition & 1 deletion gitdb/db/pack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Module containing a database to deal with packs"""
from gitdb.db.base import (
FileDBBase,
2 changes: 1 addition & 1 deletion gitdb/db/ref.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
import codecs
from gitdb.db.base import (
CompoundDB,
2 changes: 1 addition & 1 deletion gitdb/exc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Module with common exceptions"""
from gitdb.util import to_hex_sha

2 changes: 1 addition & 1 deletion gitdb/fun.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Contains basic c-functions which usually contain performance critical code
Keeping this code separate from the beginning makes it easier to out-source
it into c later, if required"""
6 changes: 3 additions & 3 deletions gitdb/pack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Contains PackIndexFile and PackFile implementations"""
import zlib

@@ -263,7 +263,7 @@ def __init__(self, indexpath):
def close(self):
mman.force_map_handle_removal_win(self._indexpath)
self._cursor = None

def _set_cache_(self, attr):
if attr == "_packfile_checksum":
self._packfile_checksum = self._cursor.map()[-40:-20]
@@ -528,7 +528,7 @@ def __init__(self, packpath):
def close(self):
mman.force_map_handle_removal_win(self._packpath)
self._cursor = None

def _set_cache_(self, attr):
# we fill the whole cache, whichever attribute gets queried first
self._cursor = mman.make_cursor(self._packpath).use_region()
10 changes: 5 additions & 5 deletions gitdb/stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/

from io import BytesIO

@@ -140,7 +140,7 @@ def data(self):
def close(self):
"""Close our underlying stream of compressed bytes if this was allowed during initialization
:return: True if we closed the underlying stream
:note: can be called safely
:note: can be called safely
"""
if self._close:
if hasattr(self._m, 'close'):
@@ -287,11 +287,11 @@ def read(self, size=-1):
# if we hit the end of the stream
# NOTE: Behavior changed in PY2.7 onward, which requires special handling to make the tests work properly.
# They are thorough, and I assume it is truly working.
# Why is this logic as convoluted as it is ? Please look at the table in
# Why is this logic as convoluted as it is ? Please look at the table in
# https://github.com/gitpython-developers/gitdb/issues/19 to learn about the test-results.
# Basically, on py2.6, you want to use branch 1, whereas on all other python version, the second branch
# will be the one that works.
# However, the zlib VERSIONs as well as the platform check is used to further match the entries in the
# will be the one that works.
# However, the zlib VERSIONs as well as the platform check is used to further match the entries in the
# table in the github issue. This is it ... it was the only way I could make this work everywhere.
# IT's CERTAINLY GOING TO BITE US IN THE FUTURE ... .
if getattr(zlib, 'ZLIB_RUNTIME_VERSION', zlib.ZLIB_VERSION) in ('1.2.7', '1.2.5') and not sys.platform == 'darwin':
2 changes: 1 addition & 1 deletion gitdb/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
2 changes: 1 addition & 1 deletion gitdb/test/db/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
2 changes: 1 addition & 1 deletion gitdb/test/db/lib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Base classes for object db testing"""
from gitdb.test.lib import (
with_rw_directory,
2 changes: 1 addition & 1 deletion gitdb/test/db/test_git.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
import os
from gitdb.test.db.lib import (
TestDBBase,
2 changes: 1 addition & 1 deletion gitdb/test/db/test_loose.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.test.db.lib import (
TestDBBase,
with_rw_directory
2 changes: 1 addition & 1 deletion gitdb/test/db/test_mem.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.test.db.lib import (
TestDBBase,
with_rw_directory
2 changes: 1 addition & 1 deletion gitdb/test/db/test_pack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.test.db.lib import (
TestDBBase,
with_rw_directory,
2 changes: 1 addition & 1 deletion gitdb/test/db/test_ref.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
from gitdb.test.db.lib import (
TestDBBase,
with_rw_directory,
2 changes: 1 addition & 1 deletion gitdb/test/lib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Utilities used in ODB testing"""
from gitdb import OStream

2 changes: 1 addition & 1 deletion gitdb/test/performance/lib.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Contains library functions"""
from gitdb.test.lib import TestBase

2 changes: 1 addition & 1 deletion gitdb/test/performance/test_pack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Performance tests for object store"""

from gitdb.test.performance.lib import (
2 changes: 1 addition & 1 deletion gitdb/test/performance/test_pack_streaming.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Specific test for pack streams only"""

from gitdb.test.performance.lib import (
2 changes: 1 addition & 1 deletion gitdb/test/performance/test_stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Performance data streaming performance"""

from gitdb.test.performance.lib import TestBigRepoR
2 changes: 1 addition & 1 deletion gitdb/test/test_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Test for object db"""
from gitdb.test.lib import (
TestBase,
2 changes: 1 addition & 1 deletion gitdb/test/test_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Module with examples from the tutorial section of the docs"""
import os
from gitdb.test.lib import TestBase
4 changes: 2 additions & 2 deletions gitdb/test/test_pack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Test everything about packs reading and writing"""
from gitdb.test.lib import (
TestBase,
@@ -242,7 +242,7 @@ def rewind_streams():
# END for each info
assert count == len(pack_objs)
entity.close()

def test_pack_64(self):
# TODO: hex-edit a pack helping us to verify that we can handle 64 byte offsets
# of course without really needing such a huge pack
2 changes: 1 addition & 1 deletion gitdb/test/test_stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Test for object db"""

from gitdb.test.lib import (
2 changes: 1 addition & 1 deletion gitdb/test/test_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Test for object db"""
import tempfile
import os
2 changes: 1 addition & 1 deletion gitdb/typ.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Module containing information about types known to the database"""

str_blob_type = b'blob'
2 changes: 1 addition & 1 deletion gitdb/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2010, 2011 Sebastian Thiel (byronimo@gmail.com) and contributors
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
# the New BSD License: https://opensource.org/license/bsd-3-clause/
import binascii
import os
import mmap