summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-10-02 07:47:32 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-10-02 07:47:32 (GMT)
commitf5961572a02ef08324f297fe93b704ff2137e5a6 (patch)
tree87819ae5462ebafe6a849cf5ee3751a210d148ff
parent7c2738cefb07e6549cafa42d1d383a3bb54ed0f3 (diff)
parent6fe5b7ff6cafcc94415deba2f3d611770d8e6b1e (diff)
downloadgit-f5961572a02ef08324f297fe93b704ff2137e5a6.zip
git-f5961572a02ef08324f297fe93b704ff2137e5a6.tar.gz
git-f5961572a02ef08324f297fe93b704ff2137e5a6.tar.bz2
Merge branch 'maint'
* maint: git-push: .git/remotes/ file does not require SP after colon git-mv: invalidate the removed path properly in cache-tree
-rw-r--r--builtin-mv.c1
-rw-r--r--builtin-push.c8
-rwxr-xr-xt/t7001-mv.sh19
3 files changed, 24 insertions, 4 deletions
diff --git a/builtin-mv.c b/builtin-mv.c
index 4d21d88..54dd3bf 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -278,6 +278,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
for (i = 0; i < deleted.nr; i++) {
const char *path = deleted.items[i].path;
remove_file_from_cache(path);
+ cache_tree_invalidate_path(active_cache_tree, path);
}
if (active_cache_changed) {
diff --git a/builtin-push.c b/builtin-push.c
index c43f256..f5150ed 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -78,12 +78,12 @@ static int get_remotes_uri(const char *repo, const char *uri[MAX_URI])
int is_refspec;
char *s, *p;
- if (!strncmp("URL: ", buffer, 5)) {
+ if (!strncmp("URL:", buffer, 4)) {
is_refspec = 0;
- s = buffer + 5;
- } else if (!strncmp("Push: ", buffer, 6)) {
+ s = buffer + 4;
+ } else if (!strncmp("Push:", buffer, 5)) {
is_refspec = 1;
- s = buffer + 6;
+ s = buffer + 5;
} else
continue;
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index b7fcdb3..23a1eff 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -86,4 +86,23 @@ test_expect_success \
'move into "."' \
'git-mv path1/path2/ .'
+test_expect_success "Michael Cassar's test case" '
+ rm -fr .git papers partA &&
+ git init-db &&
+ mkdir -p papers/unsorted papers/all-papers partA &&
+ echo a > papers/unsorted/Thesis.pdf &&
+ echo b > partA/outline.txt &&
+ echo c > papers/unsorted/_another &&
+ git add papers partA &&
+ T1=`git write-tree` &&
+
+ git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&
+
+ T=`git write-tree` &&
+ git ls-tree -r $T | grep partA/outline.txt || {
+ git ls-tree -r $T
+ (exit 1)
+ }
+'
+
test_done