File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ nbproject
1515/* egg-info
1616/.tox
1717/.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):
569569 """ Split the items into two lists of path strings and BaseEntries. """
570570 paths = []
571571 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 ):
576574 items = [items ]
577575
578576 for item in items :
@@ -806,10 +804,8 @@ def _items_to_rela_paths(self, items):
806804 """Returns a list of repo-relative paths from the given items which
807805 may be absolute or relative paths, entries or blobs"""
808806 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 ):
813809 items = [items ]
814810
815811 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):
775775
776776 @with_rw_repo ('HEAD' , bare = False )
777777 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 )
781783 assert deleted_files
782784
783785 def test_index_new (self ):
You can’t perform that action at this time.
0 commit comments