summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c
index af69f344a2..91bf876ee6 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2044,10 +2044,10 @@ static int commit_locked_index(struct lock_file *lk)
if (alternate_index_output) {
if (close_lock_file(lk))
return -1;
- if (rename(lk->filename, alternate_index_output))
+ if (rename(lk->filename.buf, alternate_index_output))
return -1;
lk->active = 0;
- lk->filename[0] = 0;
+ strbuf_reset(&lk->filename);
return 0;
} else {
return commit_lock_file(lk);