]> arthur.barton.de Git - bup.git/commitdiff
save-cmd: oops, byte counter was checking sha_missing() too late.
authorAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Mar 2010 04:16:52 +0000 (23:16 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Thu, 4 Mar 2010 04:16:52 +0000 (23:16 -0500)
After validating a backed-up file, sha_missing() goes false.  So we have to
remember the value from *before* we backed it up.  Sigh.

cmd/save-cmd.py

index 63c500516aec70cdf968bf295feedc0a692e8189..1c4b6ddac833b33350a3af5123396bc7a215acb1 100755 (executable)
@@ -137,6 +137,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
     (dir, file) = os.path.split(ent.name)
     exists = (ent.flags & index.IX_EXISTS)
     hashvalid = already_saved(ent)
+    wasmissing = ent.sha_missing()
     oldsize = ent.size
     if opt.verbose:
         if not exists:
@@ -185,7 +186,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
             else:
                 ent.validate(040000, newtree)
             ent.repack()
-        if exists and ent.sha_missing():
+        if exists and wasmissing:
             count += oldsize
         continue
 
@@ -228,7 +229,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
             ent.validate(int(mode, 8), id)
             ent.repack()
             shalists[-1].append((mode, file, id))
-    if exists and ent.sha_missing():
+    if exists and wasmissing:
         count += oldsize
         subcount = 0