mirror of
https://github.com/git/git.git
synced 2024-10-30 05:47:53 +01:00
Merge with master.
This merges commitc882bc932f
from master into our head commite764a10b17
Sincerely, jit-merge command.
This commit is contained in:
commit
c3958a7926
8 changed files with 43 additions and 12 deletions
|
@ -45,6 +45,7 @@ int sha1close(struct sha1file *f, unsigned char *result, int update)
|
||||||
sha1flush(f, 20);
|
sha1flush(f, 20);
|
||||||
if (close(f->fd))
|
if (close(f->fd))
|
||||||
die("%s: sha1 file error on close (%s)", f->name, strerror(errno));
|
die("%s: sha1 file error on close (%s)", f->name, strerror(errno));
|
||||||
|
free(f);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ if [ -n "$GIT_SSL_NO_VERIFY" ]; then
|
||||||
fi
|
fi
|
||||||
http_fetch () {
|
http_fetch () {
|
||||||
# $1 = Remote, $2 = Local
|
# $1 = Remote, $2 = Local
|
||||||
curl -ns $curl_extra_args "$1" >"$2"
|
curl -nsf $curl_extra_args "$1" >"$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
cd "$D" &&
|
cd "$D" &&
|
||||||
|
|
|
@ -15,7 +15,7 @@ http://* | https://*)
|
||||||
fi
|
fi
|
||||||
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' &&
|
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' &&
|
||||||
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" &&
|
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" &&
|
||||||
head=$(curl -ns $curl_extra_args "$merge_repo/$merge_head") &&
|
head=$(curl -nsf $curl_extra_args "$merge_repo/$merge_head") &&
|
||||||
expr "$head" : "$_x40\$" >/dev/null || {
|
expr "$head" : "$_x40\$" >/dev/null || {
|
||||||
echo >&2 "Failed to fetch $merge_head from $merge_repo"
|
echo >&2 "Failed to fetch $merge_head from $merge_repo"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -46,7 +46,7 @@ http://* | https://* )
|
||||||
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
|
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
|
||||||
curl_extra_args="-k"
|
curl_extra_args="-k"
|
||||||
fi
|
fi
|
||||||
curl -ns $curl_extra_args "$peek_repo/info/refs" || exit 1
|
curl -nsf $curl_extra_args "$peek_repo/info/refs" || exit 1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rsync://* )
|
rsync://* )
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
. git-sh-setup-script || die "Not a git archive"
|
. git-sh-setup-script || die "Not a git archive"
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
echo >&2 "Usage: git-tag-script [-a | -s] [-f] tagname"
|
echo >&2 "Usage: git-tag-script [-a | -s] [-f] [-m "tag message"] tagname"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
annotate=
|
annotate=
|
||||||
signed=
|
signed=
|
||||||
force=
|
force=
|
||||||
|
message=
|
||||||
while case "$#" in 0) break ;; esac
|
while case "$#" in 0) break ;; esac
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -24,6 +25,11 @@ do
|
||||||
-f)
|
-f)
|
||||||
force=1
|
force=1
|
||||||
;;
|
;;
|
||||||
|
-m)
|
||||||
|
annotate=1
|
||||||
|
shift
|
||||||
|
message="$1"
|
||||||
|
;;
|
||||||
-*)
|
-*)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
@ -48,10 +54,14 @@ tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
|
||||||
trap 'rm -f .tmp-tag* .tagmsg .editmsg' 0
|
trap 'rm -f .tmp-tag* .tagmsg .editmsg' 0
|
||||||
|
|
||||||
if [ "$annotate" ]; then
|
if [ "$annotate" ]; then
|
||||||
|
if [ -z "$message" ]; then
|
||||||
( echo "#"
|
( echo "#"
|
||||||
echo "# Write a tag message"
|
echo "# Write a tag message"
|
||||||
echo "#" ) > .editmsg
|
echo "#" ) > .editmsg
|
||||||
${VISUAL:-${EDITOR:-vi}} .editmsg || exit
|
${VISUAL:-${EDITOR:-vi}} .editmsg || exit
|
||||||
|
else
|
||||||
|
echo "$message" > .editmsg
|
||||||
|
fi
|
||||||
|
|
||||||
grep -v '^#' < .editmsg | git-stripspace > .tagmsg
|
grep -v '^#' < .editmsg | git-stripspace > .tagmsg
|
||||||
|
|
||||||
|
|
|
@ -382,6 +382,10 @@ static void find_deltas(struct object_entry **list, int window, int depth)
|
||||||
if (idx >= window)
|
if (idx >= window)
|
||||||
idx = 0;
|
idx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < window; ++i)
|
||||||
|
free(array[i].data);
|
||||||
|
free(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
|
9
path.c
9
path.c
|
@ -68,8 +68,13 @@ int git_mkstemp(char *path, size_t len, const char *template)
|
||||||
if ((env = getenv("TMPDIR")) == NULL) {
|
if ((env = getenv("TMPDIR")) == NULL) {
|
||||||
strcpy(pch, "/tmp/");
|
strcpy(pch, "/tmp/");
|
||||||
len -= 5;
|
len -= 5;
|
||||||
} else
|
pch += 5;
|
||||||
len -= snprintf(pch, len, "%s/", env);
|
} else {
|
||||||
|
size_t n = snprintf(pch, len, "%s/", env);
|
||||||
|
|
||||||
|
len -= n;
|
||||||
|
pch += n;
|
||||||
|
}
|
||||||
|
|
||||||
safe_strncpy(pch, template, len);
|
safe_strncpy(pch, template, len);
|
||||||
|
|
||||||
|
|
15
sha1_file.c
15
sha1_file.c
|
@ -1165,6 +1165,7 @@ void *read_object_with_reference(const unsigned char *sha1,
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
free(buffer);
|
||||||
/* Now we have the ID of the referred-to object in
|
/* Now we have the ID of the referred-to object in
|
||||||
* actual_sha1. Check again. */
|
* actual_sha1. Check again. */
|
||||||
}
|
}
|
||||||
|
@ -1296,8 +1297,11 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
unsigned long objsize;
|
unsigned long objsize;
|
||||||
int posn = 0;
|
int posn = 0;
|
||||||
void *buf = map_sha1_file_internal(sha1, &objsize);
|
void *map = map_sha1_file_internal(sha1, &objsize);
|
||||||
|
void *buf = map;
|
||||||
|
void *temp_obj = NULL;
|
||||||
z_stream stream;
|
z_stream stream;
|
||||||
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
unsigned char *unpacked;
|
unsigned char *unpacked;
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
|
@ -1313,7 +1317,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
|
||||||
memset(&stream, 0, sizeof(stream));
|
memset(&stream, 0, sizeof(stream));
|
||||||
deflateInit(&stream, Z_BEST_COMPRESSION);
|
deflateInit(&stream, Z_BEST_COMPRESSION);
|
||||||
size = deflateBound(&stream, len + hdrlen);
|
size = deflateBound(&stream, len + hdrlen);
|
||||||
buf = xmalloc(size);
|
temp_obj = buf = xmalloc(size);
|
||||||
|
|
||||||
/* Compress it */
|
/* Compress it */
|
||||||
stream.next_out = buf;
|
stream.next_out = buf;
|
||||||
|
@ -1331,6 +1335,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
|
||||||
while (deflate(&stream, Z_FINISH) == Z_OK)
|
while (deflate(&stream, Z_FINISH) == Z_OK)
|
||||||
/* nothing */;
|
/* nothing */;
|
||||||
deflateEnd(&stream);
|
deflateEnd(&stream);
|
||||||
|
free(unpacked);
|
||||||
|
|
||||||
objsize = stream.total_out;
|
objsize = stream.total_out;
|
||||||
}
|
}
|
||||||
|
@ -1347,6 +1352,12 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
|
||||||
}
|
}
|
||||||
posn += size;
|
posn += size;
|
||||||
} while (posn < objsize);
|
} while (posn < objsize);
|
||||||
|
|
||||||
|
if (map)
|
||||||
|
munmap(map, objsize);
|
||||||
|
if (temp_obj)
|
||||||
|
free(temp_obj);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue