Merge branch 'mk/rename' into next

* mk/rename:
  git-push: allow pushing from subdirectories
  GIT-VERSION-GEN: adjust for ancient git
  builtin-mv: fix use of uninitialized memory.
  debugging: XMALLOC_POISON
This commit is contained in:
Junio C Hamano
2006-08-08 17:20:25 -07:00
4 changed files with 15 additions and 3 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

2
git.c
View File

@@ -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 },