diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-17 11:57:35 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2013-08-17 11:57:35 +0100 |
commit | 17652b53bde8d7aa85a7cdd8fc6d7abcc94b2946 (patch) | |
tree | 3f18314821084229eed960c84c2eee5ac93acd8d /dgit | |
parent | 5b98b2392fc8aaef1dad7225df857d1a01a1322a (diff) |
do not use git-show-ref as it is hopeless; just do it ourselves
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -454,15 +454,17 @@ sub fetch_from_archive () { print "last upload to archive has NO git hash\n"; } - $!=0; $upload_hash = - cmdoutput_errok @git, qw(show-ref --heads), lrref(); - if ($?==0) { - die unless chomp $upload_hash; - } elsif ($?==256) { + my $lrref_fn = ".git/".lrref(); + if (open H, $lrref_fn) { + $upload_hash = <H>; + chomp $upload_hash; + die "$lrref_fn $upload_hash ?" unless $upload_hash =~ m/^\w+$/; + } elsif ($! == &ENOENT) { $upload_hash = ''; } else { - die $?; + die "$lrref_fn $!"; } + print DEBUG "last upload hash $upload_hash\n"; my $hash; if (defined $dsc_hash) { die "missing git history even though dsc has hash" |