diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-11-07 00:14:53 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-11-07 00:14:53 +0000 |
commit | 641eeadd77583420e7ad32d6a0414a24f4fc83bb (patch) | |
tree | ce8800f1d680c667e398265865de79e3922a49d4 | |
parent | e7bf758b02322662a888d347d13243501d109b74 (diff) | |
parent | 631c9e09a7fd22a5847173978c3d1357c1db74ea (diff) |
Merge branch 'master' into wip.remote
Conflicts:
debian/changelog
dgit
-rw-r--r-- | debian/changelog | 9 | ||||
-rwxr-xr-x | dgit | 34 |
2 files changed, 30 insertions, 13 deletions
diff --git a/debian/changelog b/debian/changelog index a8f074d..f57b4ac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,18 @@ dgit (0.18~experimental2) experimental; urgency=low * Merge in accidentally-dropped changes from 0.17~experimental7. + * Merge bugfix from master (unstable/testing) branch. -- +dgit (0.17) unstable; urgency=high + + * Do not grobble around in .git/refs/; instead, use git-show-ref. + This avoids breaking when git makes packed refs. Closes:728893. + * Clarify error message for missing refs/remotes/dgit/dgit/<suite>. + + -- Ian Jackson <ijackson@chiark.greenend.org.uk> Thu, 07 Nov 2013 00:02:47 +0000 + dgit (0.18~experimental1) experimental; urgency=low * No update to code. @@ -563,6 +563,23 @@ sub parsechangelog { return $c; } +sub git_get_ref ($) { + my ($refname) = @_; + my $got = cmdoutput_errok @git, qw(show-ref --), $refname; + if (!defined $got) { + $?==256 or fail "git show-ref failed (status $?)"; + printdebug "ref $refname= [show-ref exited 1]\n"; + return ''; + } + if ($got =~ m/^(\w+) \Q$refname\E$/m) { + printdebug "ref $refname=$1\n"; + return $1; + } else { + printdebug "ref $refname= [no match]\n"; + return ''; + } +} + our %rmad; sub archive_query ($) { @@ -983,22 +1000,13 @@ sub fetch_from_archive () { progress "no version available from the archive"; } - my $lrref_fn = ".git/".lrref(); - if (open H, $lrref_fn) { - $lastpush_hash = <H>; - chomp $lastpush_hash; - die "$lrref_fn $lastpush_hash ?" unless $lastpush_hash =~ m/^\w+$/; - } elsif ($! == &ENOENT) { - $lastpush_hash = ''; - } else { - die "$lrref_fn $!"; - } + $lastpush_hash = git_get_ref(lrref()); printdebug "previous reference hash=$lastpush_hash\n"; my $hash; if (defined $dsc_hash) { - fail "missing git history even though dsc has hash -". - " could not find commit $dsc_hash". - " (should be in ".access_giturl()."#".rrref().")" + fail "missing remote git history even though dsc has hash -". + " could not find ref ".lrref(). + " (should have been fetched from ".access_giturl()."#".rrref().")" unless $lastpush_hash; $hash = $dsc_hash; ensure_we_have_orig(); |