]> git.ipfire.org Git - thirdparty/git.git/commit - t/t3203-branch-output.sh
branch: introduce --show-current display option
authorDaniels Umanovskis <daniels@umanovskis.se>
Thu, 25 Oct 2018 19:04:21 +0000 (21:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Oct 2018 01:35:00 +0000 (10:35 +0900)
commit0ecb1fc7269e15be890870937b8b639c987abd08
treeedf506ae54602e0ee6aec9c10986fe928483b9bd
parent5a0cc8aca797dbd7d2be3b67458ff880ed45cddf
branch: introduce --show-current display option

When called with --show-current, git branch will print the current
branch name and terminate. Only the actual name gets printed,
without refs/heads. In detached HEAD state, nothing is output.

Intended both for scripting and interactive/informative use.
Unlike git branch --list, no filtering is needed to just get the
branch name.

Signed-off-by: Daniels Umanovskis <daniels@umanovskis.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-branch.txt
builtin/branch.c
t/t3203-branch-output.sh