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
This commit is contained in:
@ -278,6 +278,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
|||||||
for (i = 0; i < deleted.nr; i++) {
|
for (i = 0; i < deleted.nr; i++) {
|
||||||
const char *path = deleted.items[i].path;
|
const char *path = deleted.items[i].path;
|
||||||
remove_file_from_cache(path);
|
remove_file_from_cache(path);
|
||||||
|
cache_tree_invalidate_path(active_cache_tree, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_cache_changed) {
|
if (active_cache_changed) {
|
||||||
|
@ -78,12 +78,12 @@ static int get_remotes_uri(const char *repo, const char *uri[MAX_URI])
|
|||||||
int is_refspec;
|
int is_refspec;
|
||||||
char *s, *p;
|
char *s, *p;
|
||||||
|
|
||||||
if (!strncmp("URL: ", buffer, 5)) {
|
if (!strncmp("URL:", buffer, 4)) {
|
||||||
is_refspec = 0;
|
is_refspec = 0;
|
||||||
s = buffer + 5;
|
s = buffer + 4;
|
||||||
} else if (!strncmp("Push: ", buffer, 6)) {
|
} else if (!strncmp("Push:", buffer, 5)) {
|
||||||
is_refspec = 1;
|
is_refspec = 1;
|
||||||
s = buffer + 6;
|
s = buffer + 5;
|
||||||
} else
|
} else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -86,4 +86,23 @@ test_expect_success \
|
|||||||
'move into "."' \
|
'move into "."' \
|
||||||
'git-mv path1/path2/ .'
|
'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
|
test_done
|
||||||
|
Reference in New Issue
Block a user