]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/index-cmd.py
index: remove pointless git.repo() invocation
[bup.git] / lib / cmd / index-cmd.py
index fbaa0299f2d1eab9d7676ffcd1a0da128b6940dd..8941ecbf400a5c0e17b1db2263994be09c61b032 100755 (executable)
@@ -74,24 +74,22 @@ def check_index(reader):
 def clear_index(indexfile):
     indexfiles = [indexfile, indexfile + b'.meta', indexfile + b'.hlink']
     for indexfile in indexfiles:
-        path = git.repo(indexfile)
         try:
-            os.remove(path)
+            os.remove(indexfile)
             if opt.verbose:
-                log('clear: removed %s\n' % path_msg(path))
+                log('clear: removed %s\n' % path_msg(indexfile))
         except OSError as e:
             if e.errno != errno.ENOENT:
                 raise
 
 
 def update_index(top, excluded_paths, exclude_rxs, xdev_exceptions, out=None):
-    # tmax and start must be epoch nanoseconds.
+    # tmax must be epoch nanoseconds.
     tmax = (time.time() - 1) * 10**9
     ri = index.Reader(indexfile)
     msw = index.MetaStoreWriter(indexfile + b'.meta')
     wi = index.Writer(indexfile, msw, tmax)
     rig = IterHelper(ri.iter(name=top))
-    tstart = int(time.time()) * 10**9
 
     hlinks = hlinkdb.HLinkDB(indexfile + b'.hlink')
 
@@ -131,7 +129,7 @@ def update_index(top, excluded_paths, exclude_rxs, xdev_exceptions, out=None):
 
         if rig.cur and rig.cur.name == path:    # paths that already existed
             need_repack = False
-            if(rig.cur.stale(pst, tstart, check_device=opt.check_device)):
+            if(rig.cur.stale(pst, check_device=opt.check_device)):
                 try:
                     meta = metadata.from_path(path, statinfo=pst)
                 except (OSError, IOError) as e: