Skip to content

Commit 1f2362a

Browse files
marcowsgitster
authored andcommitted
builtin/commit: remove unnecessary variable definition
The file descriptor is already defined at the beginning of the function. Signed-off-by: Markus Heidelberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7327623 commit 1f2362a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/commit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
307307
* (B) on failure, rollback the real index.
308308
*/
309309
if (all || (also && pathspec && *pathspec)) {
310-
int fd = hold_locked_index(&index_lock, 1);
310+
fd = hold_locked_index(&index_lock, 1);
311311
add_files_to_cache(also ? prefix : NULL, pathspec, 0);
312312
refresh_cache_or_die(refresh_flags);
313313
if (write_cache(fd, active_cache, active_nr) ||

0 commit comments

Comments
 (0)