summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a91a1f)
raw | patch | inline | side by side (parent: 4a91a1f)
author | Alex Riesen <raa.lkml@gmail.com> | |
Wed, 31 Jan 2007 13:34:17 +0000 (14:34 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 31 Jan 2007 21:14:32 +0000 (13:14 -0800) |
In particular, it fixes the following (typical for cygwin) problem:
$ git-update-index --chmod=-x ../wrapper/Jamfile
fatal: git-update-index: cannot chmod -x '../wrapper/Jamfile'
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
$ git-update-index --chmod=-x ../wrapper/Jamfile
fatal: git-update-index: cannot chmod -x '../wrapper/Jamfile'
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-update-index.c | patch | blob | history |
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 182331d34156dd6b88d16a068efad591e07ae6b3..1ac613a78869e5b0a2ac45ca6ab72adc18a55575 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
for (i = 1 ; i < argc; i++) {
const char *path = argv[i];
+ const char *p;
if (allow_options && *path == '-') {
if (!strcmp(path, "--")) {
usage(update_index_usage);
die("unknown option %s", path);
}
- update_one(path, prefix, prefix_length);
+ p = prefix_path(prefix, prefix_length, path);
+ update_one(p, NULL, 0);
if (set_executable_bit)
- chmod_path(set_executable_bit, path);
+ chmod_path(set_executable_bit, p);
+ if (p < path || p > path + strlen(path))
+ free((char*)p);
}
if (read_from_stdin) {
struct strbuf buf;