Skip to content

Commit cbbb218

Browse files
raalkmlgitster
authored andcommitted
Fix filehandle leak in "git branch -D"
On Windows (it can't touch open files in any way) the following fails: git branch -D branch1 branch2 if the both branches are in packed-refs. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 21a0298 commit cbbb218

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

refs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ static int repack_without_ref(const char *refname)
869869
die("too long a refname '%s'", list->name);
870870
write_or_die(fd, line, len);
871871
}
872+
close(fd);
872873
return commit_lock_file(&packlock);
873874
}
874875

0 commit comments

Comments
 (0)