File tree 4 files changed +14
-14
lines changed
4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ nbproject
15
15
/* egg-info
16
16
/.tox
17
17
/.vscode /
18
+ .idea /
19
+ .cache /
Original file line number Diff line number Diff line change 1
- [submodule "gitdb "]
2
- url = https://github.com/gitpython-developers/gitdb.git
3
- path = git/ext/gitdb
1
+ [submodule "gitdb "]
2
+ url = https://github.com/gitpython-developers/gitdb.git
3
+ path = git/ext/gitdb
Original file line number Diff line number Diff line change @@ -569,10 +569,8 @@ def _preprocess_add_items(self, items):
569
569
""" Split the items into two lists of path strings and BaseEntries. """
570
570
paths = []
571
571
entries = []
572
- # check if is iterable, else put in list
573
- try :
574
- test_item = iter (items )
575
- except TypeError :
572
+ # if it is a string put in list
573
+ if isinstance (items , str ):
576
574
items = [items ]
577
575
578
576
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
806
paths = []
809
- # check if is iterable, else put in list
810
- try :
811
- test_item = iter (items )
812
- except TypeError :
807
+ # if string put in list
808
+ if isinstance (items , str ):
813
809
items = [items ]
814
810
815
811
for item in items :
Original file line number Diff line number Diff line change @@ -775,9 +775,11 @@ def test_compare_write_tree(self, rw_repo):
775
775
776
776
@with_rw_repo ('HEAD' , bare = False )
777
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 )
778
+ fp = osp .join (rw_repo .working_dir , 'testfile.txt' )
779
+ with open (fp , 'w' ) as fs :
780
+ fs .write (u'content of testfile' )
781
+ self ._assert_entries (rw_repo .index .add (fp ))
782
+ deleted_files = rw_repo .index .remove (fp )
781
783
assert deleted_files
782
784
783
785
def test_index_new (self ):
You can’t perform that action at this time.
0 commit comments