[ostree] pull: When --depth is specified, ensure we have all requested objects



commit 5bbdce2c061f1782b79bdd8cde1fd0f4b12dbac3
Author: Colin Walters <walters verbum org>
Date:   Thu Jul 26 10:17:41 2012 -0400

    pull: When --depth is specified, ensure we have all requested objects
    
    We were previously optimizing by skipping object traversal if the refs
    were unchanged, but if the user specifies a deeper depth than they did
    before.

 src/ostree/ostree-pull.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/ostree/ostree-pull.c b/src/ostree/ostree-pull.c
index d1cc5ee..2d745f1 100644
--- a/src/ostree/ostree-pull.c
+++ b/src/ostree/ostree-pull.c
@@ -1602,7 +1602,11 @@ ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error)
       if (!ostree_repo_resolve_rev (pull_data->repo, remote_ref, TRUE, &original_rev, error))
         goto out;
 
-      if (original_rev && strcmp (sha256, original_rev) == 0)
+      /* Only skip traversal if depth == 0; otherwise, we have to
+       * handle the case where the user specified a bigger depth than
+       * they originally did.
+       */
+      if (original_rev && strcmp (sha256, original_rev) == 0 && opt_depth == 0)
         {
           g_print ("No changes in %s\n", remote_ref);
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]