diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 1ce217dd7b..14923c973b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -3,9 +3,17 @@ GVF=GIT-VERSION-FILE DEF_VER=v1.4.2.GIT +LF=' +' + # First try git-describe, then see if there is a version file # (included in release tarballs), then default -if VN=$(git describe --abbrev=4 HEAD 2>/dev/null); then +if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) && + case "$VN" in + *$LF*) (exit 1) ;; + v[0-9]*) : happy ;; + esac +then VN=$(echo "$VN" | sed -e 's/-/./g'); elif test -f version then diff --git a/builtin-mv.c b/builtin-mv.c index e47942c135..ce8187c1e9 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -48,7 +48,8 @@ static const char *add_slash(const char *path) if (path[len - 1] != '/') { char *with_slash = xmalloc(len + 2); memcpy(with_slash, path, len); - strcat(with_slash + len, "/"); + with_slash[len++] = '/'; + with_slash[len] = 0; return with_slash; } return path; diff --git a/git-compat-util.h b/git-compat-util.h index 93f558056d..3bcf5b13f2 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -91,6 +91,9 @@ static inline void *xmalloc(size_t size) ret = malloc(1); if (!ret) die("Out of memory, malloc failed"); +#ifdef XMALLOC_POISON + memset(ret, 0xA5, size); +#endif return ret; } diff --git a/git.c b/git.c index 96e596b1a3..db0f86790d 100644 --- a/git.c +++ b/git.c @@ -252,7 +252,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "pack-objects", cmd_pack_objects, RUN_SETUP }, { "prune", cmd_prune, RUN_SETUP }, { "prune-packed", cmd_prune_packed, RUN_SETUP }, - { "push", cmd_push }, + { "push", cmd_push, RUN_SETUP }, { "read-tree", cmd_read_tree, RUN_SETUP }, { "repo-config", cmd_repo_config }, { "rev-list", cmd_rev_list, RUN_SETUP },