[PATCH] Update git-daemon documentation wrt. the --verbose parameter
[git.git] / diff.c
diff --git a/diff.c b/diff.c
index 05a0663..3dc0ca0 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -762,7 +762,8 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *queue,
        dp->status = 0;
        dp->source_stays = 0;
        dp->broken_pair = 0;
-       diff_q(queue, dp);
+       if (queue)
+               diff_q(queue, dp);
        return dp;
 }
 
@@ -770,6 +771,8 @@ void diff_free_filepair(struct diff_filepair *p)
 {
        diff_free_filespec_data(p->one);
        diff_free_filespec_data(p->two);
+       free(p->one);
+       free(p->two);
        free(p);
 }
 
@@ -1149,29 +1152,6 @@ void diff_addremove(int addremove, unsigned mode,
        diff_queue(&diff_queued_diff, one, two);
 }
 
-void diff_helper_input(unsigned old_mode,
-                      unsigned new_mode,
-                      const unsigned char *old_sha1,
-                      const unsigned char *new_sha1,
-                      const char *old_path,
-                      int status,
-                      int score,
-                      const char *new_path)
-{
-       struct diff_filespec *one, *two;
-       struct diff_filepair *dp;
-
-       one = alloc_filespec(old_path);
-       two = alloc_filespec(new_path);
-       if (old_mode)
-               fill_filespec(one, old_sha1, old_mode);
-       if (new_mode)
-               fill_filespec(two, new_sha1, new_mode);
-       dp = diff_queue(&diff_queued_diff, one, two);
-       dp->score = score * MAX_SCORE / 100;
-       dp->status = status;
-}
-
 void diff_change(unsigned old_mode, unsigned new_mode,
                 const unsigned char *old_sha1,
                 const unsigned char *new_sha1,