add: add --chmod=+x / --chmod=-x options
The executable bit will not be detected (and therefore will not be set) for paths in a repository with `core.filemode` set to false, though the users may still wish to add files as executable for compatibility with other users who _do_ have `core.filemode` functionality. For example, Windows users adding shell scripts may wish to add them as executable for compatibility with users on non-Windows. Although this can be done with a plumbing command (`git update-index --add --chmod=+x foo`), teaching the `git-add` command allows users to set a file executable with a command that they're already familiar with. Signed-off-by: Edward Thomson <ethomson@edwardthomson.com> Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
60bd4b1c51
commit
4e55ed32db
10
cache.h
10
cache.h
@ -367,8 +367,8 @@ extern void free_name_hash(struct index_state *istate);
|
||||
#define rename_cache_entry_at(pos, new_name) rename_index_entry_at(&the_index, (pos), (new_name))
|
||||
#define remove_cache_entry_at(pos) remove_index_entry_at(&the_index, (pos))
|
||||
#define remove_file_from_cache(path) remove_file_from_index(&the_index, (path))
|
||||
#define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags))
|
||||
#define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags))
|
||||
#define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags), 0)
|
||||
#define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags), 0)
|
||||
#define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL, NULL)
|
||||
#define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))
|
||||
#define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
|
||||
@ -581,8 +581,8 @@ extern int remove_file_from_index(struct index_state *, const char *path);
|
||||
#define ADD_CACHE_IGNORE_ERRORS 4
|
||||
#define ADD_CACHE_IGNORE_REMOVAL 8
|
||||
#define ADD_CACHE_INTENT 16
|
||||
extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags);
|
||||
extern int add_file_to_index(struct index_state *, const char *path, int flags);
|
||||
extern int add_to_index(struct index_state *, const char *path, struct stat *, int flags, int force_mode);
|
||||
extern int add_file_to_index(struct index_state *, const char *path, int flags, int force_mode);
|
||||
extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, unsigned int refresh_options);
|
||||
extern int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
|
||||
extern void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
|
||||
@ -1772,7 +1772,7 @@ void packet_trace_identity(const char *prog);
|
||||
* return 0 if success, 1 - if addition of a file failed and
|
||||
* ADD_FILES_IGNORE_ERRORS was specified in flags
|
||||
*/
|
||||
int add_files_to_cache(const char *prefix, const struct pathspec *pathspec, int flags);
|
||||
int add_files_to_cache(const char *prefix, const struct pathspec *pathspec, int flags, int force_mode);
|
||||
|
||||
/* diff.c */
|
||||
extern int diff_auto_refresh_index;
|
||||
|
||||
Reference in New Issue
Block a user