Fix broken markup in Finnish user docs translation
[empathy-mirror.git] / tools / git-which-branch.sh
blobb96b5d5e2d72a32d0737b3688f71d1b7cc0ce372
1 #!/bin/sh
2 # git-which-branch.sh - output the name of the current git branch
4 # The canonical location of this program is the telepathy-spec tools/
5 # directory, please synchronize any changes with that copy.
7 # Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
9 # Copying and distribution of this file, with or without modification,
10 # are permitted in any medium without royalty provided the copyright
11 # notice and this notice are preserved.
13 default="$1"
14 if { ref="`git symbolic-ref HEAD 2>/dev/null`"; }; then
15 echo ${ref#refs/heads/}
16 exit 0
19 if test -n "$default"; then
20 echo "$default" >/dev/null
21 exit 0
24 echo "no git branch found" >&2
25 exit 1