projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Documentation: git-ls-tree (typofix)
[git.git]
/
builtin-add.c
diff --git
a/builtin-add.c
b/builtin-add.c
index
6166f66
..
bfbbb1b
100644
(file)
--- a/
builtin-add.c
+++ b/
builtin-add.c
@@
-8,6
+8,7
@@
#include "cache.h"
#include "builtin.h"
#include "dir.h"
#include "cache.h"
#include "builtin.h"
#include "dir.h"
+#include "cache-tree.h"
static const char builtin_add_usage[] =
"git-add [-n] [-v] <filepattern>...";
static const char builtin_add_usage[] =
"git-add [-n] [-v] <filepattern>...";
@@
-117,10
+118,11
@@
static int add_file_to_index(const char *path, int verbose)
die("unable to add %s to index",path);
if (verbose)
printf("add '%s'\n", path);
die("unable to add %s to index",path);
if (verbose)
printf("add '%s'\n", path);
+ cache_tree_invalidate_path(active_cache_tree, path);
return 0;
}
return 0;
}
-static struct
cache_file cache
_file;
+static struct
lock_file lock
_file;
int cmd_add(int argc, const char **argv, char **envp)
{
int cmd_add(int argc, const char **argv, char **envp)
{
@@
-132,9
+134,9
@@
int cmd_add(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)
if (newfd < 0)
- die("unable to create new
cache
file");
+ die("unable to create new
index
file");
if (read_cache() < 0)
die("index file corrupt");
if (read_cache() < 0)
die("index file corrupt");
@@
-179,7
+181,7
@@
int cmd_add(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");
}