diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | doc/source/changes.rst | 7 | ||||
-rw-r--r-- | git/cmd.py | 5 | ||||
-rw-r--r-- | git/objects/commit.py | 2 | ||||
-rw-r--r-- | git/refs/head.py | 8 | ||||
-rw-r--r-- | git/refs/tag.py | 7 | ||||
-rw-r--r-- | git/remote.py | 6 | ||||
-rw-r--r-- | git/repo/base.py | 4 | ||||
-rw-r--r-- | git/test/test_refs.py | 11 | ||||
-rw-r--r-- | git/test/test_remote.py | 2 |
11 files changed, 42 insertions, 14 deletions
@@ -32,7 +32,7 @@ If you have downloaded the source code: or if you want to obtain a copy from the Pypi repository: - pip install gitpython + pip install GitPython Both commands will install the required package dependencies. @@ -1 +1 @@ -2.1.0 +2.1.1 diff --git a/doc/source/changes.rst b/doc/source/changes.rst index f55c0e5c..5fadf4b5 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -2,6 +2,13 @@ Changelog ========= +2.1.1 - Bugfixes +==================================== + +All issues and PRs can be viewed in all detail when following this URL: +https://github.com/gitpython-developers/GitPython/issues?q=is%3Aclosed+milestone%3A%22v2.1.1+-+Bugfixes%22 + + 2.1.0 - Much better windows support! ==================================== @@ -254,14 +254,15 @@ class Git(LazyMixin): proc.terminate() proc.wait() # ensure process goes away except OSError as ex: - log.info("Ignored error after process has dies: %r", ex) + log.info("Ignored error after process had died: %r", ex) pass # ignore error when process already died except AttributeError: # try windows # for some reason, providing None for stdout/stderr still prints something. This is why # we simply use the shell and redirect to nul. Its slower than CreateProcess, question # is whether we really want to see all these messages. Its annoying no matter what. - call(("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(proc.pid)), shell=True) + if is_win: + call(("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(proc.pid)), shell=True) # END exception handling def __getattr__(self, attr): diff --git a/git/objects/commit.py b/git/objects/commit.py index 633f7aa1..042379a8 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -93,7 +93,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): is the committed DateTime - use time.gmtime() to convert it into a different format :param committer_tz_offset: int_seconds_west_of_utc - is the timezone that the authored_date is in + is the timezone that the committed_date is in :param message: string is the commit message :param encoding: string diff --git a/git/refs/head.py b/git/refs/head.py index 9a9a8596..9ad890db 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -8,6 +8,12 @@ from .reference import Reference __all__ = ["HEAD", "Head"] +def strip_quotes(string): + if string.startswith('"') and string.endswith('"'): + return string[1:-1] + return string + + class HEAD(SymbolicReference): """Special case of a Symbolic Reference as it represents the repository's @@ -152,7 +158,7 @@ class Head(Reference): from .remote import RemoteReference reader = self.config_reader() if reader.has_option(self.k_config_remote) and reader.has_option(self.k_config_remote_ref): - ref = Head(self.repo, Head.to_full_path(reader.get_value(self.k_config_remote_ref))) + ref = Head(self.repo, Head.to_full_path(strip_quotes(reader.get_value(self.k_config_remote_ref)))) remote_refpath = RemoteReference.to_full_path(join_path(reader.get_value(self.k_config_remote), ref.name)) return RemoteReference(self.repo, remote_refpath) # END handle have tracking branch diff --git a/git/refs/tag.py b/git/refs/tag.py index cf41d971..37ee1240 100644 --- a/git/refs/tag.py +++ b/git/refs/tag.py @@ -22,14 +22,17 @@ class TagReference(Reference): @property def commit(self): - """:return: Commit object the tag ref points to""" + """:return: Commit object the tag ref points to + + :raise ValueError: if the tag points to a tree or blob""" obj = self.object while obj.type != 'commit': if obj.type == "tag": # it is a tag object which carries the commit as an object - we can point to anything obj = obj.object else: - raise ValueError("Tag %s points to a Blob or Tree - have never seen that before" % self) + raise ValueError(("Cannot resolve commit as tag %s points to a %s object - " + + "use the `.object` property instead to access it") % (self, obj.type)) return obj @property diff --git a/git/remote.py b/git/remote.py index c682837e..e5480d0e 100644 --- a/git/remote.py +++ b/git/remote.py @@ -468,7 +468,7 @@ class Remote(LazyMixin, Iterable): scmd = 'set-url' kwargs['insert_kwargs_after'] = scmd if old_url: - self.repo.git.remote(scmd, self.name, old_url, new_url, **kwargs) + self.repo.git.remote(scmd, self.name, new_url, old_url, **kwargs) else: self.repo.git.remote(scmd, self.name, new_url, **kwargs) return self @@ -706,8 +706,8 @@ class Remote(LazyMixin, Iterable): if config.get_value('fetch', default=unset) is unset: msg = "Remote '%s' has no refspec set.\n" msg += "You can set it as follows:" - msg += " 'git config --add \"remote.%s.fetch +refs/heads/*:refs/heads/*\"'." % (self.name, self.name) - raise AssertionError(msg) + msg += " 'git config --add \"remote.%s.fetch +refs/heads/*:refs/heads/*\"'." + raise AssertionError(msg % (self.name, self.name)) finally: config.release() diff --git a/git/repo/base.py b/git/repo/base.py index a9f90a17..ace5223f 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -473,7 +473,7 @@ class Repo(object): :note: to receive only commits between two named revisions, use the "revA...revB" revision specifier - :return ``git.Commit[]``""" + :return: ``git.Commit[]``""" if rev is None: rev = self.head.commit @@ -889,7 +889,7 @@ class Repo(object): if progress: handle_process_output(proc, None, progress.new_message_handler(), finalize_process) else: - (stdout, stderr) = proc.communicate() # FIXME: Will block if outputs are big! + (stdout, stderr) = proc.communicate() log.debug("Cmd(%s)'s unused stdout: %s", getattr(proc, 'args', ''), stdout) finalize_process(proc, stderr=stderr) diff --git a/git/test/test_refs.py b/git/test/test_refs.py index fd0be108..f885617e 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -119,6 +119,17 @@ class TestRefs(TestBase): assert head.tracking_branch() == remote_ref head.set_tracking_branch(None) assert head.tracking_branch() is None + + special_name = 'feature#123' + special_name_remote_ref = SymbolicReference.create(rwrepo, 'refs/remotes/origin/%s' % special_name) + gp_tracking_branch = rwrepo.create_head('gp_tracking#123') + special_name_remote_ref = rwrepo.remotes[0].refs[special_name] # get correct type + gp_tracking_branch.set_tracking_branch(special_name_remote_ref) + assert gp_tracking_branch.tracking_branch().path == special_name_remote_ref.path + + git_tracking_branch = rwrepo.create_head('git_tracking#123') + rwrepo.git.branch('-u', special_name_remote_ref.name, git_tracking_branch.name) + assert git_tracking_branch.tracking_branch().name == special_name_remote_ref.name # END for each head # verify REFLOG gets altered diff --git a/git/test/test_remote.py b/git/test/test_remote.py index aae4fb9f..4e06fbaf 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -613,7 +613,7 @@ class TestRemote(TestBase): remote.set_url(test2, delete=True) self.assertEqual(list(remote.urls), [test1, test3]) # Testing changing an URL - remote.set_url(test3, test2) + remote.set_url(test2, test3) self.assertEqual(list(remote.urls), [test1, test2]) # will raise: fatal: --add --delete doesn't make sense |