[ostree] core: Allow 'rev-parse' to resolve multiple revs



commit da00891688a8ce92e32d63dfffbd72d0c147c5b0
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 6 07:56:30 2012 -0500

    core: Allow 'rev-parse' to resolve multiple revs

 src/ostree/ot-builtin-rev-parse.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/ostree/ot-builtin-rev-parse.c b/src/ostree/ot-builtin-rev-parse.c
index b60a608..5d4bf73 100644
--- a/src/ostree/ot-builtin-rev-parse.c
+++ b/src/ostree/ot-builtin-rev-parse.c
@@ -41,6 +41,7 @@ ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GError **erro
   char *resolved_rev = NULL;
   GVariant *variant = NULL;
   char *formatted_variant = NULL;
+  int i;
 
   context = g_option_context_new ("REV - Output the target of a rev");
   g_option_context_add_main_entries (context, options, NULL);
@@ -57,12 +58,14 @@ ostree_builtin_rev_parse (int argc, char **argv, GFile *repo_path, GError **erro
       ot_util_usage_error (context, "REV must be specified", error);
       goto out;
     }
-  rev = argv[1];
-
-  if (!ostree_repo_resolve_rev (repo, rev, FALSE, &resolved_rev, error))
-    goto out;
-
-  g_print ("%s\n", resolved_rev);
+  for (i = 1; i < argc; i++)
+    {
+      rev = argv[i];
+      g_free (resolved_rev);
+      if (!ostree_repo_resolve_rev (repo, rev, FALSE, &resolved_rev, error))
+        goto out;
+      g_print ("%s\n", resolved_rev);
+    }
  
   ret = TRUE;
  out:



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