Specifically:
* Pass -q to git-symbolic-ref. That means that it doesn't print
an error message when HEAD is not a symbolic ref (ie, a
detached head), and it means that the exit status is then 1
rather than 128.
* If the return value from cmdoutput_errok is undef, check $? (which
is the exit status <<8) and then simply pass on the undef.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
to dgit private workarea. Closes:#853085.
* dgit: Strip initial newline from Changes line from dpkg-parsechangelog
so as to avoid blank line in commit messages. Closes:#853093.
+ * dgit: Do not fail when run with detached HEAD. Closes:#853022.
Test suite:
* quilt-useremail: New test for user config copying (#853085).
}
sub branchsuite () {
- my @cmd = (@git, qw(symbolic-ref HEAD));
+ 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) {
return $1;
} else {