| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 135e775 commit 624eb28
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -639,7 +639,7 @@ def is_dirty(self, index=True, working_tree=True, untracked_files=False, | |||
| 639 | 639 | if not submodules: | |
| 640 | 640 | default_args.append('--ignore-submodules') | |
| 641 | 641 | if path: | |
| 642 | - default_args.append(path) | ||
| 642 | + default_args.extend(["--", path]) | ||
| 643 | 643 | if index: | |
| 644 | 644 | # diff index against HEAD | |
| 645 | 645 | if osp.isfile(self.index.path) and \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -357,6 +357,20 @@ def test_is_dirty(self): | |||
| 357 | 357 | assert self.rorepo.is_dirty() is False | |
| 358 | 358 | self.rorepo._bare = orig_val | |
| 359 | 359 | ||
| 360 | + def test_is_dirty_pathspec(self): | ||
| 361 | + self.rorepo._bare = False | ||
| 362 | + for index in (0, 1): | ||
| 363 | + for working_tree in (0, 1): | ||
| 364 | + for untracked_files in (0, 1): | ||
| 365 | + assert self.rorepo.is_dirty(index, working_tree, untracked_files, path=':!foo') in (True, False) | ||
| 366 | + # END untracked files | ||
| 367 | + # END working tree | ||
| 368 | + # END index | ||
| 369 | + orig_val = self.rorepo._bare | ||
| 370 | + self.rorepo._bare = True | ||
| 371 | + assert self.rorepo.is_dirty() is False | ||
| 372 | + self.rorepo._bare = orig_val | ||
| 373 | + | ||
| 360 | 374 | @with_rw_repo('HEAD') | |
| 361 | 375 | def test_is_dirty_with_path(self, rwrepo): | |
| 362 | 376 | assert rwrepo.is_dirty(path="git") is False | |
| Back | FazBrowse Home | New Git URL |
0 commit comments