fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
9367d4ff7
master
1# Given the path to a .git directory this function prints a human-readable name 2# for the git action in progress (e.g. "merge") or returns 1. 3function fish_print_git_action --argument-names git_dir 4if test -z " $git_dir " 5if not command -sq git 6return 1 7end 8if not set git_dir( command git rev-parse --git-dir2> /dev/null) 9return 1 10end 11end 12 13for action_dirin " $git_dir /rebase-apply" " $git_dir /rebase" 14if test -d " $action_dir " 15if test -f " $action_dir /rebasing" 16echo -n rebase 17else if test -f " $action_dir /applying" 18echo -n apply 19else 20echo -n rebase/apply 21end 22return 0 23end 24end 25 26for action_dirin " $git_dir /rebase-merge/interactive" " $git_dir /.dotest-merge/interactive" 27if test -f " $action_dir " 28echo -n rebase-interactive 29return 0 30end 31end 32 33for action_dirin " $git_dir /rebase-merge" " $git_dir /.dotest-merge" 34if test -d " $action_dir " 35echo -n rebase-merge 36return 0 37end 38end 39 40if test -f " $git_dir /MERGE_HEAD" 41echo -n merge 42return 0 43end 44 45if test -f " $git_dir /CHERRY_PICK_HEAD" 46if test -d " $git_dir /sequencer" 47echo -n cherry-pick-sequence 48else 49echo -n cherry-pick 50end 51return 0 52end 53 54if test -f " $git_dir /REVERT_HEAD" 55if test -d " $git_dir /sequencer" 56echo -n revert-sequence 57else 58echo -n revert 59end 60return 0 61end 62 63if test -f " $git_dir /BISECT_LOG" 64echo -n bisect 65return 0 66end 67 68return 1 69end