Skip to content
  • Eli Schwartz's avatar
    update-keys: don't restore cwd in a subprocess · 5cb23e4c
    Eli Schwartz authored and Christian Hesse's avatar Christian Hesse committed
    
    
    Using popd at the very end of a shell script is unnecessary, because, as
    the very last command, there is nothing to restore state for.
    Immediately after, the shell subprocess is ended, and processes don't
    control the cwd of the parent process. Changing the cwd for the last
    microsecond of the shell process, during which no commands are run, is
    a mildly expensive no-op.
    
    By the same measure, if popd is never used, pushd is not needed to
    record the old cwd. So simply use 'cd'.
    
    Signed-off-by: default avatarChristian Hesse <mail@eworm.de>
    5cb23e4c