We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fa1ce2 commit d759e17Copy full SHA for d759e17
.gitignore
@@ -15,3 +15,5 @@ nbproject
15
/*egg-info
16
/.tox
17
/.vscode/
18
+.idea/
19
+.cache/
.gitmodules
@@ -1,3 +1,3 @@
1
-[submodule "gitdb"]
2
- url = https://github.com/gitpython-developers/gitdb.git
3
- path = git/ext/gitdb
+[submodule "gitdb"]
+ url = https://github.com/gitpython-developers/gitdb.git
+ path = git/ext/gitdb
git/index/base.py
@@ -569,10 +569,8 @@ def _preprocess_add_items(self, items):
569
""" Split the items into two lists of path strings and BaseEntries. """
570
paths = []
571
entries = []
572
- # check if is iterable, else put in list
573
- try:
574
- test_item = iter(items)
575
- except TypeError:
+ # if it is a string put in list
+ if isinstance(items, str):
576
items = [items]
577
578
for item in items:
@@ -806,10 +804,8 @@ def _items_to_rela_paths(self, items):
806
804
"""Returns a list of repo-relative paths from the given items which
807
805
may be absolute or relative paths, entries or blobs"""
808
809
810
811
812
+ # if string put in list
813
814
815
git/test/test_index.py
@@ -775,9 +775,11 @@ def test_compare_write_tree(self, rw_repo):
775
776
@with_rw_repo('HEAD', bare=False)
777
def test_index_single_addremove(self, rw_repo):
778
- path = osp.join('git', 'test', 'test_index.py')
779
- self._assert_entries(rw_repo.index.add(path))
780
- deleted_files = rw_repo.index.remove(path)
+ fp = osp.join(rw_repo.working_dir, 'testfile.txt')
+ with open(fp, 'w') as fs:
+ fs.write(u'content of testfile')
781
+ self._assert_entries(rw_repo.index.add(fp))
782
+ deleted_files = rw_repo.index.remove(fp)
783
assert deleted_files
784
785
def test_index_new(self):
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments