]> arthur.barton.de Git - bup.git/commit
save-cmd.py: don't crash when a path disappears between index and save.
authorDamien Robert <damien.olivier.robert@gmail.com>
Tue, 20 Nov 2012 20:52:45 +0000 (21:52 +0100)
committerRob Browning <rlb@defaultvalue.org>
Mon, 25 Mar 2013 00:24:54 +0000 (19:24 -0500)
commit16f9f9829038f25aec80ebfae3c882a66281e145
tree200ad43c85a70073787f2e3546be8b744539c1a8
parent76b12e16dcf623973c31329d6f8234907d6a1074
save-cmd.py: don't crash when a path disappears between index and save.

Protect calls to metadata.from_path() with a try/catch and defer
errors via add_error() instead of just crashing.

Signed-off-by: Damien Robert <damien.olivier.robert@gmail.com>
[git@tim-riemenschneider.de: rebase to current tmp/pending/meta: since
 metadata is (now) stored in the index, only 1 of 2 hunks still
 applies (race condition between reading the file for its content and
 stat-ing it for metadata).]
[rlb@defaultvalue.org: edit commit message; squash file and dir
 removal fixes into this commit; limit the scope of the try/catch to
 the from_path() call, and put the remaining code in an else clause.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
cmd/save-cmd.py