diff options
author | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2016-01-08 16:42:16 +0200 |
---|---|---|
committer | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2016-01-08 16:42:16 +0200 |
commit | a948edfc8d92fc9dec54a2c8441700b3053e7b0e (patch) | |
tree | e14594f1976b5d222aa74b0bea071b342f2bd1c1 | |
parent | 99fe6e2f7aeff041de0aee9b2c3a53a8d11c6add (diff) |
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-x | git-gpgcrypt | 6 |
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 |