зеркало из https://github.com/microsoft/git.git
Merge branch 'maint'
* maint: completion: add missing options to show-branch and show dir.c: clean up handling of 'path' parameter in read_directory_recursive() Fix type-punning issues
This commit is contained in:
Коммит
55524fcf9d
|
@ -1837,7 +1837,7 @@ _git_show ()
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--*)
|
--*)
|
||||||
__gitcomp "--pretty= --format=
|
__gitcomp "--pretty= --format= --abbrev-commit --oneline
|
||||||
$__git_diff_common_options
|
$__git_diff_common_options
|
||||||
"
|
"
|
||||||
return
|
return
|
||||||
|
@ -1854,7 +1854,7 @@ _git_show_branch ()
|
||||||
__gitcomp "
|
__gitcomp "
|
||||||
--all --remotes --topo-order --current --more=
|
--all --remotes --topo-order --current --more=
|
||||||
--list --independent --merge-base --no-name
|
--list --independent --merge-base --no-name
|
||||||
--sha1-name --topics --reflog
|
--sha1-name --sparse --topics --reflog
|
||||||
"
|
"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
|
|
||||||
static unsigned int hash_obj(const struct object *obj, unsigned int n)
|
static unsigned int hash_obj(const struct object *obj, unsigned int n)
|
||||||
{
|
{
|
||||||
unsigned int hash = *(unsigned int *)obj->sha1;
|
unsigned int hash;
|
||||||
|
|
||||||
|
memcpy(&hash, obj->sha1, sizeof(unsigned int));
|
||||||
return hash % n;
|
return hash % n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
dir.c
2
dir.c
|
@ -576,7 +576,7 @@ static int get_dtype(struct dirent *de, const char *path)
|
||||||
*/
|
*/
|
||||||
static int read_directory_recursive(struct dir_struct *dir, const char *path, const char *base, int baselen, int check_only, const struct path_simplify *simplify)
|
static int read_directory_recursive(struct dir_struct *dir, const char *path, const char *base, int baselen, int check_only, const struct path_simplify *simplify)
|
||||||
{
|
{
|
||||||
DIR *fdir = opendir(path);
|
DIR *fdir = opendir(*path ? path : ".");
|
||||||
int contents = 0;
|
int contents = 0;
|
||||||
|
|
||||||
if (fdir) {
|
if (fdir) {
|
||||||
|
|
3
object.c
3
object.c
|
@ -45,7 +45,8 @@ int type_from_string(const char *str)
|
||||||
|
|
||||||
static unsigned int hash_obj(struct object *obj, unsigned int n)
|
static unsigned int hash_obj(struct object *obj, unsigned int n)
|
||||||
{
|
{
|
||||||
unsigned int hash = *(unsigned int *)obj->sha1;
|
unsigned int hash;
|
||||||
|
memcpy(&hash, obj->sha1, sizeof(unsigned int));
|
||||||
return hash % n;
|
return hash % n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче