summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit22
1 files changed, 20 insertions, 2 deletions
diff --git a/dgit b/dgit
index 9cdf96b..6b1201e 100755
--- a/dgit
+++ b/dgit
@@ -1699,6 +1699,11 @@ sub prep_ud (;$) {
sub mktree_in_ud_here () {
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);
+ foreach my $copy (qw(user.email user.name user.useConfigOnly)) {
+ my $v = $gitcfgs{local}{$copy};
+ next unless $v;
+ runcmd qw(git config), $copy, $_ foreach @$v;
+ }
rmtree('.git/objects');
symlink '../../../../objects','.git/objects' or die $!;
setup_gitattrs(1);
@@ -1990,7 +1995,14 @@ sub make_commit_text ($) {
sub clogp_authline ($) {
my ($clogp) = @_;
my $author = getfield $clogp, 'Maintainer';
- $author =~ s#,.*##ms;
+ if ($author =~ m/^[^"\@]+\,/) {
+ # single entry Maintainer field with unquoted comma
+ $author = ($& =~ y/,//rd).$'; # strip the comma
+ }
+ # git wants a single author; any remaining commas in $author
+ # are by now preceded by @ (or "). It seems safer to punt on
+ # "..." for now rather than attempting to dequote or something.
+ $author =~ s#,.*##ms unless $author =~ m/"/;
my $date = cmdoutput qw(date), '+%s %z', qw(-d), getfield($clogp,'Date');
my $authline = "$author $date";
$authline =~ m/$git_authline_re/o or
@@ -2312,6 +2324,7 @@ sub generate_commits_from_dsc () {
my $authline = clogp_authline $clogp;
my $changes = getfield $clogp, 'Changes';
+ $changes =~ s/^\n//; # Changes: \n
my $cversion = getfield $clogp, 'Version';
if (@tartrees) {
@@ -4429,7 +4442,12 @@ sub cmd_clone {
}
sub branchsuite () {
- my $branch = cmdoutput_errok @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 {