chiark / gitweb /
dgit: changedir: use confess, to get a stack trace
[dgit.git] / dgit
diff --git a/dgit b/dgit
index af3a96a5b824ad2577460c1ede775ca408d9833e..a78e2fbc6d7e3ecc0011b397335dda90fcfc2b44 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -222,7 +222,7 @@ sub no_such_package () {
 sub changedir ($) {
     my ($newdir) = @_;
     printdebug "CD $newdir\n";
-    chdir $newdir or die "chdir: $newdir: $!";
+    chdir $newdir or confess "chdir: $newdir: $!";
 }
 
 sub deliberately ($) {
@@ -1802,8 +1802,11 @@ sub mergeinfo_version ($) {
 }
 
 sub fetch_from_archive () {
-    # ensures that lrref() is what is actually in the archive,
-    #  one way or another
+    # Ensures that lrref() is what is actually in the archive, one way
+    # or another, according to us - ie this client's
+    # appropritaely-updated archive view.  Also returns the commit id.
+    # If there is nothing in the archive, leaves lrref alone and
+    # returns undef.
     get_archive_dsc();
 
     if ($dsc) {
@@ -1997,7 +2000,7 @@ But we were not able to obtain any version from the archive or git.
 END
        }
        unshift @end, $del_lrfetchrefs;
-       return 0;
+       return undef;
     }
 
     if ($lastfetch_hash &&
@@ -2148,7 +2151,7 @@ END
     lrfetchref_used lrfetchref();
 
     unshift @end, $del_lrfetchrefs;
-    return 1;
+    return $hash;
 }
 
 sub set_local_git_config ($$) {
@@ -2617,6 +2620,8 @@ END
        $changesfile = "$buildproductsdir/$changesfile";
     }
 
+    # Checks complete, we're going to try and go ahead:
+
     responder_send_file('changes',$changesfile);
     responder_send_command("param head $dgithead");
     responder_send_command("param csuite $csuite");