chiark / gitweb /
fetch_from_archive: Return the hash (and update the comment)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Sep 2016 11:32:49 +0000 (12:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Sep 2016 12:27:59 +0000 (13:27 +0100)
All the call sites currently treat the return value as a boolean, and
the truthiness and falsishness of return values is unchanged, so there
is no overall functional change.

Also, clarify the head comment somewhat.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 5fecf290fca31e8cde479562369beed1f1f647ae..a25c74c18bf87a25205da4cfa6562e7e4a234205 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1802,9 +1802,11 @@ sub mergeinfo_version ($) {
 }
 
 sub fetch_from_archive () {
 }
 
 sub fetch_from_archive () {
-    # Ensures that lrref() is what is actually in the archive,
-    #  one way or another.  If there is nothing in the archive,
-    #  leaves lrref alone and returns 0.
+    # 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) {
     get_archive_dsc();
 
     if ($dsc) {
@@ -1998,7 +2000,7 @@ But we were not able to obtain any version from the archive or git.
 END
        }
        unshift @end, $del_lrfetchrefs;
 END
        }
        unshift @end, $del_lrfetchrefs;
-       return 0;
+       return undef;
     }
 
     if ($lastfetch_hash &&
     }
 
     if ($lastfetch_hash &&
@@ -2149,7 +2151,7 @@ END
     lrfetchref_used lrfetchref();
 
     unshift @end, $del_lrfetchrefs;
     lrfetchref_used lrfetchref();
 
     unshift @end, $del_lrfetchrefs;
-    return 1;
+    return $hash;
 }
 
 sub set_local_git_config ($$) {
 }
 
 sub set_local_git_config ($$) {