~ubuntu-branches/ubuntu/wily/telepathy-glib/wily

« back to all changes in this revision

Viewing changes to tools/git-which-branch.sh

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2009-03-24 22:06:52 UTC
  • mfrom: (1.3.1 upstream) (17.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20090324220652-c8dvom0nsqomp23d
Tags: 0.7.28-1
* New upstream version (ABI, API added)
* Put the -dbg package in section debug, as per recent archive changes
* Remove obsolete Conflicts/Replaces with libtelepathy-glib-static-dev, which
  was never in a stable release (and probably never in Debian at all)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# git-which-branch.sh - output the name of the current git branch
 
3
#
 
4
# The canonical location of this program is the telepathy-spec tools/
 
5
# directory, please synchronize any changes with that copy.
 
6
#
 
7
# Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
 
8
#
 
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.
 
12
 
 
13
default="$1"
 
14
if { ref="`git symbolic-ref HEAD 2>/dev/null`"; }; then
 
15
    echo ${ref#refs/heads/}
 
16
    exit 0
 
17
fi
 
18
 
 
19
if test -n "$default"; then
 
20
    echo "$default" >/dev/null
 
21
    exit 0
 
22
fi
 
23
 
 
24
echo "no git branch found" >&2
 
25
exit 1