chiark / gitweb /
test suite: Test GIT_REFLOG_ACTION setting by git-debrebase
[dgit.git] / tests / tstunt / gpg-locked
index ddb880f6c208fa7cb47a6938c67e1f09ec3bf87d..f2351b4f103ea7f1e73a2fccb1937980b6bcbb52 100755 (executable)
@@ -29,17 +29,20 @@ if [ $rc != 2 ]; then exit $rc; fi
 
 echo >&2 "WARNING - GNUPG FAILED $rc - STUNT GNUPG $attempt $stdin_tmp_bytes $*"
 
-sh -ec '
-       if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then
-               exec >"$DGIT_GNUPG_STUNT_ERRLOG"
-       else
-               exec 2>/dev/null
-       fi
-       exec >/dev/tty
-       printf "%s\n" "$*"
-' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $stdin_tmp_bytes $*"
-
-sleep 10
+if [ "$stdin_tmp_bytes" = 0 ]; then
+       sleep 5
+else
+       sh -ec '
+               if [ "x$DGIT_GNUPG_STUNT_ERRLOG" != x ]; then
+                       exec >"$DGIT_GNUPG_STUNT_ERRLOG"
+               else
+                       exec 2>/dev/null
+               fi
+               exec >/dev/tty
+               printf "%s\n" "$*"
+       ' x "GNUPG WRAPPER - TROUBLE - $HOME $GNUPGHOME - FAILED $rc $attempt $stdin_tmp_bytes $*" ||:
+       sleep 10
+fi
 
 done