projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Off-by-one error in get_path_prefix(), found by Valgrind
[git.git]
/
builtin-rm.c
diff --git
a/builtin-rm.c
b/builtin-rm.c
index
e7793a2
..
ef2f8b5
100644
(file)
--- a/
builtin-rm.c
+++ b/
builtin-rm.c
@@
-41,7
+41,7
@@
static int remove_file(const char *name)
return ret;
}
return ret;
}
-static struct
cache_file cache
_file;
+static struct
lock_file lock
_file;
int cmd_rm(int argc, const char **argv, char **envp)
{
int cmd_rm(int argc, const char **argv, char **envp)
{
@@
-53,7
+53,7
@@
int cmd_rm(int argc, const char **argv, char **envp)
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)
die("unable to create new index file");
if (newfd < 0)
die("unable to create new index file");
@@
-144,7
+144,7
@@
int cmd_rm(int argc, const char **argv, char **envp)
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_
index_file(&cache
_file))
+ commit_
lock_file(&lock
_file))
die("Unable to write new index file");
}
die("Unable to write new index file");
}