2020-06-22 00:05:26 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# This script is for mocking fzf for testing,
|
|
|
|
# it will stop fzf for goin into a interactive mode
|
|
|
|
#
|
|
|
|
# usage:
|
|
|
|
# export PATH="${BATS_TEST_DIRNAME}:$PATH"
|
|
|
|
|
2020-06-23 07:05:50 +00:00
|
|
|
if [[ "$*" =~ "--header=Select a commit to checkout" ]] && [[ "$*" =~ "show --color" ]]; then
|
|
|
|
echo "--commitshow"
|
|
|
|
elif [[ "$*" =~ "--no-multi --header=Select a branch to checkout" ]]; then
|
|
|
|
echo "--branch"
|
|
|
|
elif [[ "$*" =~ "--header=select a file to checkout version in HEAD --preview" ]]; then
|
|
|
|
echo "-- modifiedfile"
|
|
|
|
elif [[ "$*" =~ '--header=select a file to checkout' ]] && [[ "$*" =~ "cat" ]]; then
|
|
|
|
echo "selectgitfile"
|
|
|
|
elif [[ "$*" =~ '--header=select the target commit' ]] && [[ "$*" =~ "diff --color" ]]; then
|
|
|
|
echo "commitdiff"
|
|
|
|
fi
|