]> git.ipfire.org Git - thirdparty/git.git/blobdiff - patch-ids.c
Merge branch 'js/params-vs-args'
[thirdparty/git.git] / patch-ids.c
index 21973e49332c36532438bb067c8821a0e377baf9..3f404e4b0b4cc24d02ae9cbf3c8498c37f673094 100644 (file)
@@ -1,7 +1,7 @@
 #include "cache.h"
 #include "diff.h"
 #include "commit.h"
-#include "sha1-lookup.h"
+#include "hash-lookup.h"
 #include "patch-ids.h"
 
 static int patch_id_defined(struct commit *commit)
@@ -89,7 +89,7 @@ static int init_patch_id_entry(struct patch_id *patch,
        return 0;
 }
 
-struct patch_id *has_commit_patch_id(struct commit *commit,
+struct patch_id *patch_id_iter_first(struct commit *commit,
                                     struct patch_ids *ids)
 {
        struct patch_id patch;
@@ -104,6 +104,18 @@ struct patch_id *has_commit_patch_id(struct commit *commit,
        return hashmap_get_entry(&ids->patches, &patch, ent, NULL);
 }
 
+struct patch_id *patch_id_iter_next(struct patch_id *cur,
+                                   struct patch_ids *ids)
+{
+       return hashmap_get_next_entry(&ids->patches, cur, ent);
+}
+
+int has_commit_patch_id(struct commit *commit,
+                       struct patch_ids *ids)
+{
+       return !!patch_id_iter_first(commit, ids);
+}
+
 struct patch_id *add_commit_patch_id(struct commit *commit,
                                     struct patch_ids *ids)
 {