[PATCH] Don't use undefined variable



Here I think we have a cut'n'paste error.

The 'name' variable may be undefined, if 'dirs' &
'files' are both empty at the same time.

I think the code was intended as per the patch.

-- 
Vincent Legoll
Index: vc/git.py
===================================================================
--- vc/git.py	(revision 1182)
+++ vc/git.py	(working copy)
@@ -139,7 +139,8 @@
         for path, state in tree.iteritems():
             # removed files are not in the filesystem, so must be added here
             if state is _vc.STATE_REMOVED:
-                if os.path.dirname(path) == directory:
+                dir, name = os.path.split(path)
+                if dir == directory:
                     retfiles.append( _vc.File(path, name, state) )
         return retdirs, retfiles
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]