Commit 57053ba7 authored by Xu Wang's avatar Xu Wang
Browse files

suppress the error message from expect to prevent leaking passphrase

parent 9e5b432f
Loading
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -34,13 +34,12 @@ function verify_gpg_passphrase() {
} 

function do_unlock() {
  echo unlock $PWD 
  keyfile=$1
  if [ ! -z $keyfile ];
  then
    git-crypt unlock $keyfile
  else
    expect <<EOF
    expect 2> /dev/null <<EOF
spawn git-crypt unlock
expect "Enter passphrase:"
send "$passphrase\r";
@@ -74,10 +73,15 @@ do
    skip "Skipping $m; Please update module with: git submodule init $m && git submodule update $m."
    continue
  else
    ( echo "Checking out $i master branch"
    ( 
      echo
      echo
      echo "==== Unlocking $m ===="
      echo "Checking out $i master branch"
      cd $m
      git checkout master
      do_unlock $keyfile
      echo "==== End of $m ===="
    )
  fi
done