summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-25 20:57:41 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 12:25:49 +0100
commit7ae49acddbd78c5e446f9e1fc5b02ef7d09ae925 (patch)
tree1043ee52f15cd47b5a24779bd5b75e022aeedb8d /dgit
parente07f113726f46b8ab921ceecd4e282d93b39c2a2 (diff)
Dgit.pm: Break out git_get_symref
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit9
1 files changed, 2 insertions, 7 deletions
diff --git a/dgit b/dgit
index 9ce7972..aaafefb 100755
--- a/dgit
+++ b/dgit
@@ -4511,13 +4511,8 @@ sub cmd_clone {
}
sub branchsuite () {
- my @cmd = (@git, qw(symbolic-ref -q HEAD));
- my $branch = cmdoutput_errok @cmd;
- if (!defined $branch) {
- $?==256 or failedcmd @cmd;
- return undef;
- }
- if ($branch =~ m#$lbranch_re#o) {
+ my $branch = git_get_symref();
+ if (defined $branch && $branch =~ m#$lbranch_re#o) {
return $1;
} else {
return undef;