meld r1202 - trunk/vc



Author: vincele
Date: Mon Mar  2 22:15:45 2009
New Revision: 1202
URL: http://svn.gnome.org/viewvc/meld?rev=1202&view=rev

Log:
Don't use potentially undefined variable

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


Modified:
   trunk/vc/git.py

Modified: trunk/vc/git.py
==============================================================================
--- trunk/vc/git.py	(original)
+++ trunk/vc/git.py	Mon Mar  2 22:15:45 2009
@@ -138,7 +138,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]