summaryrefslogtreecommitdiffstats
path: root/git_part.c
diff options
context:
space:
mode:
Diffstat (limited to 'git_part.c')
-rw-r--r--git_part.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/git_part.c b/git_part.c
index beaf5d0..5d4ab8f 100644
--- a/git_part.c
+++ b/git_part.c
@@ -99,22 +99,24 @@ void print_commits(int dir_fd,const git_reference *branch, git_repository *repo)
}
void print_commit(git_commit *current_commit,git_commit *parent_commit,FILE *log_file,int diff_directory_fd,git_repository *repo)
{
- git_tree *current_tree;
- git_tree *parent_tree;
- FILE *diff_file;
+ git_tree *current_tree;
+ git_tree *parent_tree;
+ FILE *diff_file;
- git_commit_tree(&current_tree,current_commit);
- if(parent_commit==NULL)
- parent_tree=NULL;
- else
- git_commit_tree(&parent_tree,parent_commit);
+ git_commit_tree(&current_tree,current_commit);
+ if(parent_commit==NULL)
+ parent_tree=NULL;
+ else
+ git_commit_tree(&parent_tree,parent_commit);
+
+ diff_file=create_file(diff_directory_fd,git_oid_tostr_s(git_commit_id(current_commit)));
- diff_file=create_file(diff_directory_fd,git_oid_tostr_s(git_commit_id(current_commit)));
+ print_diff(diff_file,parent_tree,current_tree,repo);
- print_diff(diff_file,parent_tree,current_tree,repo);
+ git_tree_free(parent_tree);
+ print_headers_and_commit_message(log_file,current_commit,git_commit_id(current_commit),1);
- git_tree_free(parent_tree);
- print_headers_and_commit_message(log_file,current_commit,git_commit_id(current_commit),1);
+ close_file(diff_file);
}
void print_branches(git_repository *repo)
@@ -160,6 +162,7 @@ void print_files(int dir_fd,git_tree *tree,git_repository *repo)
print_entry(index_file,current_entry,dir_fd,repo);
fprintf(index_file,"\n<br>\n");
}
+ close_file(index_file);
}
void print_files_top(int dir_fd,git_commit *top_commit,git_repository *repo)
{