diff options
| -rw-r--r-- | commit.c | 3 | ||||
| -rw-r--r-- | diffcore-rename.c | 2 | 
2 files changed, 4 insertions, 1 deletions
@@ -560,6 +560,9 @@ void sort_in_topological_order(struct commit_list ** list)  		next = next->next;  		count++;  	} +	 +	if (!count) +		return;  	/* allocate an array to help sort the list */  	nodes = xcalloc(count, sizeof(*nodes));  	/* link the list to the array */ diff --git a/diffcore-rename.c b/diffcore-rename.c index dba965c0b4..39d9126cb9 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -282,7 +282,7 @@ void diffcore_rename(struct diff_options *options)  		else if (detect_rename == DIFF_DETECT_COPY)  			register_rename_src(p->one, 1);  	} -	if (rename_dst_nr == 0 || +	if (rename_dst_nr == 0 || rename_src_nr == 0 ||  	    (0 < rename_limit && rename_limit < rename_dst_nr))  		goto cleanup; /* nothing to do */  | 
