Skip to content

Commit

Permalink
Fix issue where diff preview was broken on mac (#365)
Browse files Browse the repository at this point in the history
Closes #362
  • Loading branch information
cjappl authored Mar 14, 2024
1 parent 86dfdf8 commit 2436fc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/git-forgit
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ _forgit_diff() {
# oldfile\0
# We have to do a two-step sed -> tr pipe because OSX's sed implementation does
# not support the null-character directly.
get_files="echo {} | sed 's/\\\\s*\\\\[.]\\\\s*//' | sed 's/ -> /\\\n/' | tr '\\\n' '\\\0'"
get_files="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z0-9]*\\\\][[:space:]]*//' | sed 's/ -> /\\\n/' | tr '\\\n' '\\\0'"
# Similar to the line above, but only gets a single file from a single line
# Gets the new name of renamed files
get_file="echo {} | sed 's/\\\\s*\\\\[.]\\\\s*//' | sed 's/.*-> //'"
get_file="echo {} | sed -e 's/^[[:space:]]*\\\\[[A-Z0-9]*\\\\][[:space:]]*//' | sed 's/.*-> //'"
# Git stashes are named "stash@{x}", which contains the fzf placeholder "{x}".
# In order to support passing stashes as arguments to _forgit_diff, we have to
# prevent fzf from interpreting this substring by escaping the opening bracket.
Expand Down

0 comments on commit 2436fc4

Please sign in to comment.