]> git.ipfire.org Git - thirdparty/git.git/blobdiff - progress.c
Use new HASHMAP_INIT macro to simplify hashmap initialization
[thirdparty/git.git] / progress.c
index 3eda914518bfdcd211552d41b5439125b1ea27ed..31014e6fca0512d16b0fbcc35c7fbfd43426e5c8 100644 (file)
@@ -319,9 +319,12 @@ static void finish_if_sparse(struct progress *progress)
 
 void stop_progress(struct progress **p_progress)
 {
+       if (!p_progress)
+               BUG("don't provide NULL to stop_progress");
+
        finish_if_sparse(*p_progress);
 
-       if (p_progress && *p_progress) {
+       if (*p_progress) {
                trace2_data_intmax("progress", the_repository, "total_objects",
                                   (*p_progress)->total);
 
@@ -338,7 +341,12 @@ void stop_progress(struct progress **p_progress)
 
 void stop_progress_msg(struct progress **p_progress, const char *msg)
 {
-       struct progress *progress = *p_progress;
+       struct progress *progress;
+
+       if (!p_progress)
+               BUG("don't provide NULL to stop_progress_msg");
+
+       progress = *p_progress;
        if (!progress)
                return;
        *p_progress = NULL;