diff options
| author | Junio C Hamano <junkio@cox.net> | 2007-02-03 22:14:40 -0800 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2007-02-03 23:05:34 -0800 |
| commit | d77ee72662a821d66ae218056f0103eb24d8d4b4 (patch) | |
| tree | e22abdbd11735a0669362f934ae723d233c87e2b /builtin-update-index.c | |
| parent | eb8381c88518b10d683a29deea1d43ed671f14ec (diff) | |
| parent | 8d0fc48f27304ac1bc7abf802ec53fe66fedb15a (diff) | |
| download | git-d77ee72662a821d66ae218056f0103eb24d8d4b4.tar.gz | |
Merge branch 'master' into np/dreflog
This is to resolve conflicts early in preparation for possible
inclusion of "reflog on detached HEAD" series by Nico, as having
it in 1.5.0 would really help us remove confusion between
detached and attached states.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-update-index.c')
| -rw-r--r-- | builtin-update-index.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin-update-index.c b/builtin-update-index.c index 182331d341..1ac613a788 100644 --- a/builtin-update-index.c +++ b/builtin-update-index.c @@ -501,6 +501,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) for (i = 1 ; i < argc; i++) { const char *path = argv[i]; + const char *p; if (allow_options && *path == '-') { if (!strcmp(path, "--")) { @@ -616,9 +617,12 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) 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; |
