Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Close the index file between writing and committing
author
Johannes Schindelin
<Johannes.Schindelin@gmx.de>
Sat, 8 Jul 2006 08:56:28 +0000
(10:56 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Sat, 8 Jul 2006 10:28:19 +0000
(
03:28
-0700)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-add.c
patch
|
blob
|
history
builtin-apply.c
patch
|
blob
|
history
builtin-read-tree.c
patch
|
blob
|
history
builtin-rm.c
patch
|
blob
|
history
builtin-update-index.c
patch
|
blob
|
history
builtin-write-tree.c
patch
|
blob
|
history
checkout-index.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a0c2089
)
diff --git
a/builtin-add.c
b/builtin-add.c
index bfbbb1bf52e10667f94dd574ab32fe070c98c4cb..2d256981733345f4a430e11812b6851f0351aabd 100644
(file)
--- a/
builtin-add.c
+++ b/
builtin-add.c
@@
-181,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_lock_file(&lock_file))
+ c
lose(newfd) || c
ommit_lock_file(&lock_file))
die("Unable to write new index file");
}
die("Unable to write new index file");
}
diff --git
a/builtin-apply.c
b/builtin-apply.c
index e9ead002d38368f6de6ba75f25542fe61258cfb9..c3af48917c9a96ce86442bea737f4a81c7e0fb55 100644
(file)
--- a/
builtin-apply.c
+++ b/
builtin-apply.c
@@
-2323,7
+2323,7
@@
int cmd_apply(int argc, const char **argv, char **envp)
if (write_index) {
if (write_cache(newfd, active_cache, active_nr) ||
if (write_index) {
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ c
lose(newfd) || c
ommit_lock_file(&lock_file))
die("Unable to write new index file");
}
die("Unable to write new index file");
}
diff --git
a/builtin-read-tree.c
b/builtin-read-tree.c
index 9a2099d7307903d62c85f3483a22969ab5094c84..23a8d92a4b77e7436069c976bc5fa0ec162a9324 100644
(file)
--- a/
builtin-read-tree.c
+++ b/
builtin-read-tree.c
@@
-1038,7
+1038,7
@@
int cmd_read_tree(int argc, const char **argv, char **envp)
}
if (write_cache(newfd, active_cache, active_nr) ||
}
if (write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file))
+ c
lose(newfd) || c
ommit_lock_file(&lock_file))
die("unable to write new index file");
return 0;
}
die("unable to write new index file");
return 0;
}
diff --git
a/builtin-rm.c
b/builtin-rm.c
index 4d56a1f07065e6e8ebaa95fdfe843cffb6283af3..875d8252fa72cf7adc1d6bb254ebc3a5995e49dd 100644
(file)
--- a/
builtin-rm.c
+++ b/
builtin-rm.c
@@
-147,7
+147,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_lock_file(&lock_file))
+ c
lose(newfd) || c
ommit_lock_file(&lock_file))
die("Unable to write new index file");
}
die("Unable to write new index file");
}
diff --git
a/builtin-update-index.c
b/builtin-update-index.c
index ef50243452c2f27572c941a5db9365c785f1fbd5..1a4200d151dd8e876c6f84531422cae50b049aa3 100644
(file)
--- a/
builtin-update-index.c
+++ b/
builtin-update-index.c
@@
-648,7
+648,7
@@
int cmd_update_index(int argc, const char **argv, char **envp)
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_lock_file(lock_file))
+ c
lose(newfd) || c
ommit_lock_file(lock_file))
die("Unable to write new index file");
}
die("Unable to write new index file");
}
diff --git
a/builtin-write-tree.c
b/builtin-write-tree.c
index 70e9b6fcc6d93e9b869a0a1eac144cbea3ecba3f..449a4d1b575b591aa07a40532649f9ea06eb6890 100644
(file)
--- a/
builtin-write-tree.c
+++ b/
builtin-write-tree.c
@@
-35,7
+35,8
@@
int write_tree(unsigned char *sha1, int missing_ok, const char *prefix)
missing_ok, 0) < 0)
die("git-write-tree: error building trees");
if (0 <= newfd) {
missing_ok, 0) < 0)
die("git-write-tree: error building trees");
if (0 <= newfd) {
- if (!write_cache(newfd, active_cache, active_nr))
+ if (!write_cache(newfd, active_cache, active_nr)
+ && !close(newfd))
commit_lock_file(lock_file);
}
/* Not being able to write is fine -- we are only interested
commit_lock_file(lock_file);
}
/* Not being able to write is fine -- we are only interested
diff --git
a/checkout-index.c
b/checkout-index.c
index ea40bc29bed17fbd6e3326edaa6fb3c38b742de6..29279555086ce36cdf598e390898a46888543846 100644
(file)
--- a/
checkout-index.c
+++ b/
checkout-index.c
@@
-311,7
+311,7
@@
int main(int argc, char **argv)
if (0 <= newfd &&
(write_cache(newfd, active_cache, active_nr) ||
if (0 <= newfd &&
(write_cache(newfd, active_cache, active_nr) ||
- commit_lock_file(&lock_file)))
+ c
lose(newfd) || c
ommit_lock_file(&lock_file)))
die("Unable to write new index file");
return 0;
}
die("Unable to write new index file");
return 0;
}