mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +01:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
2
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 },
|
||||
|
||||
Reference in New Issue
Block a user