wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

Use correct IFS store/restore mechanism #306

Closed carlfriedrich closed 1 year ago

carlfriedrich commented 1 year ago

The previous implementation had the problem that if IFS was not set before, it was set to an empty string after restoring, which is not the same as being unset. This broke grc / git forgit revert_commit, since "git revert" was being interpreted as the command name instead of command and argument.

The correct way is to check whether IFS is unset and, if so, unset it again afterwards.

See for reference: https://unix.stackexchange.com/a/264947/317320

Fix #301.

Check list

Description

Type of change

Test environment

carlfriedrich commented 1 year ago

@cjappl Can you check if this PR fixes grc for you?

cjappl commented 1 year ago

Works like a charm! Great sleuthing @carlfriedrich .

I'm going to merge