From 720ec6b870ba913affd0f6c01d5a61b9b2c5aadb Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 4 Feb 2009 10:32:06 +0100 Subject: [PATCH 1/4] Missing && in t/t7001.sh. Without this, the exit status is only the one of the last line. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t7001-mv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 19493c805..539effe69 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -55,7 +55,7 @@ test_expect_success \ git mv -k untracked1 untracked2 path0 && test -f untracked1 && test -f untracked2 && - test ! -f path0/untracked1 + test ! -f path0/untracked1 && test ! -f path0/untracked2' # clean up the mess in case bad things happen From c8ba6b1b199bf00f227e8fdad4adb5a2147c8160 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 4 Feb 2009 10:32:07 +0100 Subject: [PATCH 2/4] Add a testcase for "git mv -f" on untracked files. This currently fails with: git: builtin-mv.c:217: cmd_mv: Assertion `pos >= 0' failed. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t7001-mv.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 539effe69..ef7e56ed6 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -58,6 +58,14 @@ test_expect_success \ test ! -f path0/untracked1 && test ! -f path0/untracked2' +test_expect_failure \ + 'checking -f on untracked file with existing target' \ + 'touch path0/untracked1 && + git mv -f untracked1 path0 + test ! -f .git/index.lock && + test -f untracked1 && + test -f path0/untracked1' + # clean up the mess in case bad things happen rm -f idontexist untracked1 untracked2 \ path0/idontexist path0/untracked1 path0/untracked2 \ From 5aed3c6ab834367292bd7a9b0894177a07afd910 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Wed, 4 Feb 2009 10:32:08 +0100 Subject: [PATCH 3/4] builtin-mv.c: check for unversionned files before looking at the destination. The previous code was failing in the case where one moves an unversionned file to an existing destination, with mv -f: the "existing destination" was checked first, and the error was cancelled by the force flag. We now check the unrecoverable error first, which fixes the bug. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- builtin-mv.c | 8 ++++---- t/t7001-mv.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin-mv.c b/builtin-mv.c index bce995929..01270fefd 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -162,7 +162,9 @@ int cmd_mv(int argc, const char **argv, const char *prefix) } argc += last - first; } - } else if (lstat(dst, &st) == 0) { + } else if (cache_name_pos(src, length) < 0) + bad = "not under version control"; + else if (lstat(dst, &st) == 0) { bad = "destination exists"; if (force) { /* @@ -177,9 +179,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) } else bad = "Cannot overwrite"; } - } else if (cache_name_pos(src, length) < 0) - bad = "not under version control"; - else if (string_list_has_string(&src_for_dst, dst)) + } else if (string_list_has_string(&src_for_dst, dst)) bad = "multiple sources for the same target"; else string_list_insert(dst, &src_for_dst); diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index ef7e56ed6..d2ec550af 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -58,7 +58,7 @@ test_expect_success \ test ! -f path0/untracked1 && test ! -f path0/untracked2' -test_expect_failure \ +test_expect_success \ 'checking -f on untracked file with existing target' \ 'touch path0/untracked1 && git mv -f untracked1 path0 From f26b5dc9efccc998510505685d6d919b4dd087e7 Mon Sep 17 00:00:00 2001 From: Stefan Naewe Date: Wed, 4 Feb 2009 21:49:35 +0100 Subject: [PATCH 4/4] urls.txt: document optional port specification in git URLS Signed-off-by: Stefan Naewe Signed-off-by: Junio C Hamano --- Documentation/urls.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/urls.txt b/Documentation/urls.txt index fa34c6747..5355ebc0f 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -6,10 +6,10 @@ to name the remote repository: =============================================================== - rsync://host.xz/path/to/repo.git/ -- http://host.xz/path/to/repo.git/ -- https://host.xz/path/to/repo.git/ -- git://host.xz/path/to/repo.git/ -- git://host.xz/~user/path/to/repo.git/ +- http://host.xz{startsb}:port{endsb}/path/to/repo.git/ +- https://host.xz{startsb}:port{endsb}/path/to/repo.git/ +- git://host.xz{startsb}:port{endsb}/path/to/repo.git/ +- git://host.xz{startsb}:port{endsb}/~user/path/to/repo.git/ - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/ - ssh://{startsb}user@{endsb}host.xz/path/to/repo.git/ - ssh://{startsb}user@{endsb}host.xz/~user/path/to/repo.git/