projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make index file locking code reusable to others.
[git.git]
/
update-index.c
diff --git
a/update-index.c
b/update-index.c
index
956b6b3
..
fbccc4a
100644
(file)
--- a/
update-index.c
+++ b/
update-index.c
@@
-186,7
+186,7
@@
static void chmod_path(int flip, const char *path)
die("git-update-index: cannot chmod %cx '%s'", flip, path);
}
die("git-update-index: cannot chmod %cx '%s'", flip, path);
}
-static struct
cache_file cache
_file;
+static struct
lock_file lock
_file;
static void update_one(const char *path, const char *prefix, int prefix_length)
{
static void update_one(const char *path, const char *prefix, int prefix_length)
{
@@
-489,9
+489,9
@@
int main(int argc, const char **argv)
git_config(git_default_config);
git_config(git_default_config);
- newfd = hold_
index_file_for_update(&cache
_file, get_index_file());
+ newfd = hold_
lock_file_for_update(&lock
_file, get_index_file());
if (newfd < 0)
if (newfd < 0)
- die("unable to create new
cache
file");
+ die("unable to create new
index
file");
entries = read_cache();
if (entries < 0)
entries = read_cache();
if (entries < 0)
@@
-645,8
+645,8
@@
int main(int argc, const char **argv)
finish:
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
finish:
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_
index_file(&cache
_file))
- die("Unable to write new
cache
file");
+ commit_
lock_file(&lock
_file))
+ die("Unable to write new
index
file");
}
return has_errors ? 1 : 0;
}
return has_errors ? 1 : 0;