| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5117c9c commit 5bb8122
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,7 +95,7 @@ def count(cls, repo, ref): | |||
| 95 | 95 | Returns | |
| 96 | 96 | int | |
| 97 | 97 | """ | |
| 98 | - return len(repo.git.rev_list(ref).strip().splitlines()) | ||
| 98 | + return len(repo.git.rev_list(ref, '--').strip().splitlines()) | ||
| 99 | 99 | ||
| 100 | 100 | @classmethod | |
| 101 | 101 | def find_all(cls, repo, ref, **kwargs): | |
@@ -118,7 +118,7 @@ def find_all(cls, repo, ref, **kwargs): | |||
| 118 | 118 | options = {'pretty': 'raw'} | |
| 119 | 119 | options.update(kwargs) | |
| 120 | 120 | ||
| 121 | - output = repo.git.rev_list(ref, **options) | ||
| 121 | + output = repo.git.rev_list(ref, '--', **options) | ||
| 122 | 122 | return cls.list_from_string(repo, output) | |
| 123 | 123 | ||
| 124 | 124 | @classmethod | |
@@ -214,14 +214,14 @@ def diffs(self): | |||
| 214 | 214 | @property | |
| 215 | 215 | def stats(self): | |
| 216 | 216 | if not self.parents: | |
| 217 | - text = self.repo.git.diff(self.id, numstat=True) | ||
| 217 | + text = self.repo.git.diff(self.id, '--', numstat=True) | ||
| 218 | 218 | text2 = "" | |
| 219 | 219 | for line in text.splitlines(): | |
| 220 | 220 | (insertions, deletions, filename) = line.split("\t") | |
| 221 | 221 | text2 += "%s\t%s\t%s\n" % (deletions, insertions, filename) | |
| 222 | 222 | text = text2 | |
| 223 | 223 | else: | |
| 224 | - text = self.repo.git.diff(self.parents[0].id, self.id, numstat=True) | ||
| 224 | + text = self.repo.git.diff(self.parents[0].id, self.id, '--', numstat=True) | ||
| 225 | 225 | return stats.Stats.list_from_string(self.repo, text) | |
| 226 | 226 | ||
| 227 | 227 | def __str__(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -192,8 +192,8 @@ def commit_deltas_from(self, other_repo, ref = 'master', other_ref = 'master'): | |||
| 192 | 192 | Returns | |
| 193 | 193 | ``git.Commit[]`` | |
| 194 | 194 | """ | |
| 195 | - repo_refs = self.git.rev_list(ref).strip().splitlines() | ||
| 196 | - other_repo_refs = other_repo.git.rev_list(other_ref).strip().splitlines() | ||
| 195 | + repo_refs = self.git.rev_list(ref, '--').strip().splitlines() | ||
| 196 | + other_repo_refs = other_repo.git.rev_list(other_ref, '--').strip().splitlines() | ||
| 197 | 197 | ||
| 198 | 198 | diff_refs = list(set(other_repo_refs) - set(repo_refs)) | |
| 199 | 199 | return map(lambda ref: Commit.find_all(other_repo, ref, max_count=1)[0], diff_refs) | |
@@ -236,10 +236,9 @@ def log(self, commit = 'master', path = None, **kwargs): | |||
| 236 | 236 | """ | |
| 237 | 237 | options = {'pretty': 'raw'} | |
| 238 | 238 | options.update(kwargs) | |
| 239 | + arg = [commit, '--'] | ||
| 239 | 240 | if path: | |
| 240 | - arg = [commit, '--', path] | ||
| 241 | - else: | ||
| 242 | - arg = [commit] | ||
| 241 | + arg.append(path) | ||
| 243 | 242 | commits = self.git.log(*arg, **options) | |
| 244 | 243 | return Commit.list_from_string(self, commits) | |
| 245 | 244 | ||
@@ -450,7 +449,7 @@ def is_dirty(self): | |||
| 450 | 449 | # always consired to be clean. | |
| 451 | 450 | return False | |
| 452 | 451 | ||
| 453 | - return len(self.git.diff('HEAD').strip()) > 0 | ||
| 452 | + return len(self.git.diff('HEAD', '--').strip()) > 0 | ||
| 454 | 453 | ||
| 455 | 454 | @property | |
| 456 | 455 | def active_branch(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ def test_bake(self, git): | |||
| 22 | 22 | assert_equal("tom@mojombo.com", commit.author.email) | |
| 23 | 23 | ||
| 24 | 24 | assert_true(git.called) | |
| 25 | - assert_equal(git.call_args, (('rev_list', '4c8124ffcf4039d292442eeccabdeca5af5c5017'), {'pretty': 'raw', 'max_count': 1})) | ||
| 25 | + assert_equal(git.call_args, (('rev_list', '4c8124ffcf4039d292442eeccabdeca5af5c5017', '--'), {'pretty': 'raw', 'max_count': 1})) | ||
| 26 | 26 | ||
| 27 | 27 | @patch_object(Git, '_call_process') | |
| 28 | 28 | def test_id_abbrev(self, git): | |
@@ -184,7 +184,7 @@ def test_stats(self, git): | |||
| 184 | 184 | assert_equal(["a.txt", "b.txt"], keys) | |
| 185 | 185 | ||
| 186 | 186 | assert_true(git.called) | |
| 187 | - assert_equal(git.call_args, (('diff', '634396b2f541a9f2d58b00be1a07f0c358b999b3'), {'numstat': True})) | ||
| 187 | + assert_equal(git.call_args, (('diff', '634396b2f541a9f2d58b00be1a07f0c358b999b3', '--'), {'numstat': True})) | ||
| 188 | 188 | ||
| 189 | 189 | @patch_object(Git, '_call_process') | |
| 190 | 190 | def test_rev_list_bisect_all(self, git): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,7 @@ def test_commits(self, git): | |||
| 70 | 70 | assert_equal("Merge branch 'site'", c.message) | |
| 71 | 71 | ||
| 72 | 72 | assert_true(git.called) | |
| 73 | - assert_equal(git.call_args, (('rev_list', 'master'), {'skip': 0, 'pretty': 'raw', 'max_count': 10})) | ||
| 73 | + assert_equal(git.call_args, (('rev_list', 'master', '--'), {'skip': 0, 'pretty': 'raw', 'max_count': 10})) | ||
| 74 | 74 | ||
| 75 | 75 | @patch_object(Git, '_call_process') | |
| 76 | 76 | def test_commit_count(self, git): | |
@@ -79,7 +79,7 @@ def test_commit_count(self, git): | |||
| 79 | 79 | assert_equal(655, self.repo.commit_count('master')) | |
| 80 | 80 | ||
| 81 | 81 | assert_true(git.called) | |
| 82 | - assert_equal(git.call_args, (('rev_list', 'master'), {})) | ||
| 82 | + assert_equal(git.call_args, (('rev_list', 'master', '--'), {})) | ||
| 83 | 83 | ||
| 84 | 84 | @patch_object(Git, '_call_process') | |
| 85 | 85 | def test_commit(self, git): | |
@@ -90,7 +90,7 @@ def test_commit(self, git): | |||
| 90 | 90 | assert_equal("4c8124ffcf4039d292442eeccabdeca5af5c5017", commit.id) | |
| 91 | 91 | ||
| 92 | 92 | assert_true(git.called) | |
| 93 | - assert_equal(git.call_args, (('rev_list', '4c8124ffcf4039d292442eeccabdeca5af5c5017'), {'pretty': 'raw', 'max_count': 1})) | ||
| 93 | + assert_equal(git.call_args, (('rev_list', '4c8124ffcf4039d292442eeccabdeca5af5c5017', '--'), {'pretty': 'raw', 'max_count': 1})) | ||
| 94 | 94 | ||
| 95 | 95 | @patch_object(Git, '_call_process') | |
| 96 | 96 | def test_tree(self, git): | |
@@ -269,7 +269,7 @@ def test_log(self, git): | |||
| 269 | 269 | assert_equal('ab25fd8483882c3bda8a458ad2965d2248654335', self.repo.log()[-1].id) | |
| 270 | 270 | assert_true(git.called) | |
| 271 | 271 | assert_equal(git.call_count, 2) | |
| 272 | - assert_equal(git.call_args, (('log', 'master'), {'pretty': 'raw'})) | ||
| 272 | + assert_equal(git.call_args, (('log', 'master', '--'), {'pretty': 'raw'})) | ||
| 273 | 273 | ||
| 274 | 274 | @patch_object(Git, '_call_process') | |
| 275 | 275 | def test_log_with_path_and_options(self, git): | |
@@ -314,14 +314,14 @@ def test_is_dirty_with_clean_working_dir(self, git): | |||
| 314 | 314 | self.repo.bare = False | |
| 315 | 315 | git.return_value = '' | |
| 316 | 316 | assert_false(self.repo.is_dirty) | |
| 317 | - assert_equal(git.call_args, (('diff', 'HEAD'), {})) | ||
| 317 | + assert_equal(git.call_args, (('diff', 'HEAD', '--'), {})) | ||
| 318 | 318 | ||
| 319 | 319 | @patch_object(Git, '_call_process') | |
| 320 | 320 | def test_is_dirty_with_dirty_working_dir(self, git): | |
| 321 | 321 | self.repo.bare = False | |
| 322 | 322 | git.return_value = '''-aaa\n+bbb''' | |
| 323 | 323 | assert_true(self.repo.is_dirty) | |
| 324 | - assert_equal(git.call_args, (('diff', 'HEAD'), {})) | ||
| 324 | + assert_equal(git.call_args, (('diff', 'HEAD', '--'), {})) | ||
| 325 | 325 | ||
| 326 | 326 | @patch_object(Git, '_call_process') | |
| 327 | 327 | def test_active_branch(self, git): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments