aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes-1.5.6.3.txt42
-rw-r--r--builtin-clone.c7
-rw-r--r--builtin-send-pack.c3
-rwxr-xr-xcontrib/completion/git-completion.bash30
-rwxr-xr-xgit-submodule.sh3
-rw-r--r--refs.c2
-rwxr-xr-xt/t5404-tracking-branches.sh7
-rwxr-xr-xt/t5601-clone.sh20
8 files changed, 106 insertions, 8 deletions
diff --git a/Documentation/RelNotes-1.5.6.3.txt b/Documentation/RelNotes-1.5.6.3.txt
new file mode 100644
index 000000000..dd0559b64
--- /dev/null
+++ b/Documentation/RelNotes-1.5.6.3.txt
@@ -0,0 +1,42 @@
+GIT v1.5.6.3 Release Notes
+==========================
+
+Fixes since v1.5.6.2
+--------------------
+
+* Setting GIT_TRACE will report spawning of external process via run_command().
+
+* Bash completion script did not notice '--' marker on the command
+ line and tried the relatively slow "ref completion" even when
+ completing arguments after one.
+
+* Registering a non-empty blob racily and then truncating the working
+ tree file for it confused "racy-git avoidance" logic into thinking
+ that the path is now unchanged.
+
+* "git clone" had a leftover debugging fprintf().
+
+* "git clone -q" was not quiet enough as it used to and gave object count
+ and progress reports.
+
+* "git clone" marked downloaded packfile with .keep; this could be a
+ good thing if the remote side is well packed but otherwise not,
+ especially for a project that is not really big.
+
+* The section that describes attributes related to git-archive were placed
+ in a wrong place in the gitattributes(5) manual page.
+
+* When "git push" tries to remove a remote ref, and corresponding
+ tracking ref is missing, we used to report error (i.e. failure to
+ remove something that does not exist).
+
+* "git mailinfo" (hence "git am") did not handle commit log messages in a
+ MIME multipart mail correctly.
+
+Contains other various documentation fixes.
+
+--
+exec >/var/tmp/1
+O=v1.5.6.2-23-ge965647
+echo O=$(git describe maint)
+git shortlog --no-merges $O..maint
diff --git a/builtin-clone.c b/builtin-clone.c
index 4a0f1ab8a..ec3620960 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -341,6 +341,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
const struct ref *refs, *head_points_at, *remote_head, *mapped_refs;
char branch_top[256], key[256], value[256];
struct strbuf reflog_msg;
+ struct transport *transport = NULL;
struct refspec refspec;
@@ -462,8 +463,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
refs = clone_local(path, git_dir);
else {
struct remote *remote = remote_get(argv[0]);
- struct transport *transport =
- transport_get(remote, remote->url[0]);
+ transport = transport_get(remote, remote->url[0]);
if (!transport->get_refs_list || !transport->fetch)
die("Don't know how to clone %s", transport->url);
@@ -533,6 +533,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
option_no_checkout = 1;
}
+ if (transport)
+ transport_unlock_pack(transport);
+
if (!option_no_checkout) {
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
struct unpack_trees_options opts;
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index d76260c09..a708d0af4 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
if (args.verbose)
fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
if (ref->deletion) {
- if (delete_ref(rs.dst, NULL))
- error("Failed to delete");
+ delete_ref(rs.dst, NULL);
} else
update_ref("update by push", rs.dst,
ref->new_sha1, NULL, 0, 0);
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index cc75ad7cc..27332ed8b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -451,6 +451,18 @@ __git_find_subcommand ()
done
}
+__git_has_doubledash ()
+{
+ local c=1
+ while [ $c -lt $COMP_CWORD ]; do
+ if [ "--" = "${COMP_WORDS[c]}" ]; then
+ return 0
+ fi
+ c=$((++c))
+ done
+ return 1
+}
+
__git_whitespacelist="nowarn warn error error-all strip"
_git_am ()
@@ -497,6 +509,8 @@ _git_apply ()
_git_add ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -511,6 +525,8 @@ _git_add ()
_git_bisect ()
{
+ __git_has_doubledash && return
+
local subcommands="start bad good skip reset visualize replay log run"
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
@@ -613,6 +629,8 @@ _git_cherry_pick ()
_git_commit ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -632,6 +650,8 @@ _git_describe ()
_git_diff ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -734,6 +754,8 @@ _git_ls_tree ()
_git_log ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
@@ -1086,6 +1108,8 @@ _git_remote ()
_git_reset ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -1098,6 +1122,8 @@ _git_reset ()
_git_shortlog ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@@ -1144,6 +1170,8 @@ _git_stash ()
_git_submodule ()
{
+ __git_has_doubledash && return
+
local subcommands="add status init update"
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -1350,6 +1378,8 @@ _git ()
_gitk ()
{
+ __git_has_doubledash && return
+
local cur="${COMP_WORDS[COMP_CWORD]}"
local g="$(git rev-parse --git-dir 2>/dev/null)"
local merge=""
diff --git a/git-submodule.sh b/git-submodule.sh
index 3eb78cc72..099a7d756 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -167,8 +167,7 @@ cmd_add()
# perhaps the path exists and is already a git repo, else clone it
if test -e "$path"
then
- if test -d "$path/.git" &&
- test "$(unset GIT_DIR; cd $path; git rev-parse --git-dir)" = ".git"
+ if test -d "$path"/.git -o -f "$path"/.git
then
echo "Adding existing repo at '$path' to the index"
else
diff --git a/refs.c b/refs.c
index 6c6e9e5e1..39a3b2380 100644
--- a/refs.c
+++ b/refs.c
@@ -925,7 +925,7 @@ int delete_ref(const char *refname, const unsigned char *sha1)
i = strlen(lock->lk->filename) - 5; /* .lock */
lock->lk->filename[i] = 0;
err = unlink(lock->lk->filename);
- if (err) {
+ if (err && errno != ENOENT) {
ret = 1;
error("unlink(%s) failed: %s",
lock->lk->filename, strerror(errno));
diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh
index 1493a92c0..64fe2615a 100755
--- a/t/t5404-tracking-branches.sh
+++ b/t/t5404-tracking-branches.sh
@@ -10,6 +10,7 @@ test_expect_success 'setup' '
git commit -m 1 &&
git branch b1 &&
git branch b2 &&
+ git branch b3 &&
git clone . aa &&
git checkout b1 &&
echo b1 >>file &&
@@ -50,4 +51,10 @@ test_expect_success 'deleted branches have their tracking branches removed' '
test "$(git rev-parse origin/b1)" = "origin/b1"
'
+test_expect_success 'already deleted tracking branches ignored' '
+ git branch -d -r origin/b3 &&
+ git push origin :b3 >output 2>&1 &&
+ ! grep error output
+'
+
test_done
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index b642fb260..d785b3df7 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -17,14 +17,32 @@ test_expect_success setup '
'
-test_expect_success 'clone with excess parameters' '
+test_expect_success 'clone with excess parameters (1)' '
+ rm -fr dst &&
+ test_must_fail git clone -n src dst junk
+
+'
+
+test_expect_success 'clone with excess parameters (2)' '
+
+ rm -fr dst &&
test_must_fail git clone -n "file://$(pwd)/src" dst junk
'
+test_expect_success 'clone does not keep pack' '
+
+ rm -fr dst &&
+ git clone -n "file://$(pwd)/src" dst &&
+ ! test -f dst/file &&
+ ! (echo dst/.git/objects/pack/pack-* | grep "\.keep")
+
+'
+
test_expect_success 'clone checks out files' '
+ rm -fr dst &&
git clone src dst &&
test -f dst/file