aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-16 23:08:49 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-16 23:08:49 -0700
commit55524fcf9d6676ca3840227092bf3a14ba404615 (patch)
tree82e8251a255c5f962f1d5dce75fd14c97cbc3ba9
parent671d1bc6a098d1015fbdd6e085d6daf12c1dce15 (diff)
parent076c32370d8a6ac2fb57b2a55c674942e106f8ab (diff)
downloadgit-55524fcf9d6676ca3840227092bf3a14ba404615.tar.gz
git-55524fcf9d6676ca3840227092bf3a14ba404615.tar.xz
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
-rwxr-xr-xcontrib/completion/git-completion.bash4
-rw-r--r--decorate.c4
-rw-r--r--dir.c2
-rw-r--r--object.c3
4 files changed, 8 insertions, 5 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b6bcd5cc2..f8d4cb2c7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1837,7 +1837,7 @@ _git_show ()
return
;;
--*)
- __gitcomp "--pretty= --format=
+ __gitcomp "--pretty= --format= --abbrev-commit --oneline
$__git_diff_common_options
"
return
@@ -1854,7 +1854,7 @@ _git_show_branch ()
__gitcomp "
--all --remotes --topo-order --current --more=
--list --independent --merge-base --no-name
- --sha1-name --topics --reflog
+ --sha1-name --sparse --topics --reflog
"
return
;;
diff --git a/decorate.c b/decorate.c
index 82d9e221e..e6fd8a744 100644
--- a/decorate.c
+++ b/decorate.c
@@ -8,7 +8,9 @@
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;
}
diff --git a/dir.c b/dir.c
index 6aae09a22..0e6b752cd 100644
--- a/dir.c
+++ b/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)
{
- DIR *fdir = opendir(path);
+ DIR *fdir = opendir(*path ? path : ".");
int contents = 0;
if (fdir) {
diff --git a/object.c b/object.c
index 7e6a92c88..e1feef9c3 100644
--- a/object.c
+++ b/object.c
@@ -45,7 +45,8 @@ int type_from_string(const char *str)
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;
}