aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-01-08 16:42:16 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2016-01-08 16:42:16 +0200
commita948edfc8d92fc9dec54a2c8441700b3053e7b0e (patch)
treee14594f1976b5d222aa74b0bea071b342f2bd1c1
parent99fe6e2f7aeff041de0aee9b2c3a53a8d11c6add (diff)
downloadgit-gpgcrypt-master.tar.gz
Explicitly remove encrypted files before "git checkout -f ."HEADmaster
On some systems (Arch Linux reported) "git checkout -f ." doesn't work as expected - even so there --force switch, already existing files are not updated, i.e. not decrypted. Change-Id: Ibaac9f59591261e2eae5c4274b4c5ecd429074d6
-rwxr-xr-xgit-gpgcrypt6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-gpgcrypt b/git-gpgcrypt
index caef5bc..1bd0a90 100755
--- a/git-gpgcrypt
+++ b/git-gpgcrypt
@@ -39,6 +39,12 @@ init() {
echo "directory and run 'git checkout .', or )"
else
setup_filters
+ # Plain "git checkout -f ." works on all systems except Arch, where
+ # if fails to re-checkout already existing files. So, remove them
+ # first, taking care to not remove special files.
+ find . -type f | grep -v -E "^(\./\.(git|gpg))" | xargs --no-run-if-empty -n 20 rm
+ # After filters have been set up, force re-checkout of all files to
+ # decrypt them.
git checkout -f .
echo "Initialized a clone"
fi