summaryrefslogtreecommitdiff
path: root/lockfile.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-06-13 19:19:24 +0700
committerJunio C Hamano <gitster@pobox.com>2014-06-13 11:49:38 -0700
commit626f35c89332059980251f7cdf8e94bc49d68834 (patch)
treeac9a21a42736c8d42f4ba97dcd97f0b034c2966f /lockfile.c
parent03b86647722f11ccc321cd7279aa49b811d17cc2 (diff)
downloadgit-626f35c89332059980251f7cdf8e94bc49d68834.tar.gz
read-cache: relocate and unexport commit_locked_index()
This function is now only used by write_locked_index(). Move it to read-cache.c (because read-cache.c will need to be aware of alternate_index_output later) and unexport it. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'lockfile.c')
-rw-r--r--lockfile.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/lockfile.c b/lockfile.c
index 8fbcb6a98a..b706614349 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -5,7 +5,6 @@
#include "sigchain.h"
static struct lock_file *lock_file_list;
-static const char *alternate_index_output;
static void remove_lock_file(void)
{
@@ -252,25 +251,6 @@ int hold_locked_index(struct lock_file *lk, int die_on_error)
: 0);
}
-void set_alternate_index_output(const char *name)
-{
- alternate_index_output = name;
-}
-
-int commit_locked_index(struct lock_file *lk)
-{
- if (alternate_index_output) {
- if (lk->fd >= 0 && close_lock_file(lk))
- return -1;
- if (rename(lk->filename, alternate_index_output))
- return -1;
- lk->filename[0] = 0;
- return 0;
- }
- else
- return commit_lock_file(lk);
-}
-
void rollback_lock_file(struct lock_file *lk)
{
if (lk->filename[0]) {