mirror of
				https://github.com/oh-my-fish/theme-bobthefish.git
				synced 2025-06-13 13:03:54 +00:00 
			
		
		
		
	Add better tag support in the git branch segment.
This commit is contained in:
		
							parent
							
								
									b2f097c91c
								
							
						
					
					
						commit
						4669e3dad6
					
				| @ -52,11 +52,15 @@ | |||||||
| 
 | 
 | ||||||
| function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' | function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' | ||||||
|   set -l ref (command git symbolic-ref HEAD ^/dev/null) |   set -l ref (command git symbolic-ref HEAD ^/dev/null) | ||||||
|   if [ $status -gt 0 ] |     and echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #" | ||||||
|  |     and return | ||||||
|  | 
 | ||||||
|  |   set -l tag (command git describe --tags --exact-match ^/dev/null) | ||||||
|  |     and echo "$__bobthefish_tag_glyph $tag" | ||||||
|  |     and return | ||||||
|  | 
 | ||||||
|   set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null) |   set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null) | ||||||
|     set ref "$__bobthefish_detached_glyph $branch" |   echo "$__bobthefish_detached_glyph $branch" | ||||||
|   end |  | ||||||
|   echo $ref | sed "s#refs/heads/#$__bobthefish_branch_glyph #" |  | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| function __bobthefish_hg_branch -S -d 'Get the current hg branch' | function __bobthefish_hg_branch -S -d 'Get the current hg branch' | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user