From 5bb812243dd1815651281a54c8191fc8e2bc2d82 Mon Sep 17 00:00:00 2001 From: Paul Sowden Date: Wed, 19 Nov 2008 23:03:54 -0800 Subject: remove ambiguity between paths and treeishs When calling commands that accept treeish and path arguments and there is a path with the same name as a treeish git cowardly refuses to pick one and asks for the command to use the unambiguous syntax where '--' seperates the treeish from the paths. Add '--' to the git commands to indicate that the argument is a treeish and not a path. (cherry picked from commit a9a57fa93a2b121ab9b17fcd6062b9a9c9740883) --- lib/git/commit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/git/commit.py') diff --git a/lib/git/commit.py b/lib/git/commit.py index 8b7bdfa8..c50d9d2d 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -95,7 +95,7 @@ class Commit(LazyMixin): Returns int """ - return len(repo.git.rev_list(ref).strip().splitlines()) + return len(repo.git.rev_list(ref, '--').strip().splitlines()) @classmethod def find_all(cls, repo, ref, **kwargs): @@ -118,7 +118,7 @@ class Commit(LazyMixin): options = {'pretty': 'raw'} options.update(kwargs) - output = repo.git.rev_list(ref, **options) + output = repo.git.rev_list(ref, '--', **options) return cls.list_from_string(repo, output) @classmethod @@ -214,14 +214,14 @@ class Commit(LazyMixin): @property def stats(self): if not self.parents: - text = self.repo.git.diff(self.id, numstat=True) + text = self.repo.git.diff(self.id, '--', numstat=True) text2 = "" for line in text.splitlines(): (insertions, deletions, filename) = line.split("\t") text2 += "%s\t%s\t%s\n" % (deletions, insertions, filename) text = text2 else: - text = self.repo.git.diff(self.parents[0].id, self.id, numstat=True) + text = self.repo.git.diff(self.parents[0].id, self.id, '--', numstat=True) return stats.Stats.list_from_string(self.repo, text) def __str__(self): -- cgit v1.2.1