mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +01:00
Merge branch 'mw/pathinfo' into next
* mw/pathinfo: gitweb: start to generate PATH_INFO URLs. git-push: .git/remotes/ file does not require SP after colon git-mv: invalidate the removed path properly in cache-tree Makefile: install and clean merge-recur, still. GIT 1.4.3-rc1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.4.2.GIT
|
||||
DEF_VER=v1.4.3.GIT
|
||||
|
||||
LF='
|
||||
'
|
||||
|
||||
6
Makefile
6
Makefile
@@ -215,7 +215,8 @@ BUILT_INS = \
|
||||
$(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
|
||||
|
||||
# what 'all' will build and 'install' will install, in gitexecdir
|
||||
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
|
||||
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) \
|
||||
git-merge-recur$X
|
||||
|
||||
# Backward compatibility -- to be removed after 1.0
|
||||
PROGRAMS += git-ssh-pull$X git-ssh-push$X
|
||||
@@ -589,8 +590,7 @@ export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
|
||||
|
||||
### Build rules
|
||||
|
||||
all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi \
|
||||
git-merge-recur$X
|
||||
all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
|
||||
|
||||
all: perl/Makefile
|
||||
$(MAKE) -C perl
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -102,6 +102,10 @@ our %feature = (
|
||||
'sub' => \&feature_pickaxe,
|
||||
'override' => 0,
|
||||
'default' => [1]},
|
||||
|
||||
'pathinfo' => {
|
||||
'override' => 0,
|
||||
'default' => [0]},
|
||||
);
|
||||
|
||||
sub gitweb_check_feature {
|
||||
@@ -375,6 +379,7 @@ exit;
|
||||
|
||||
sub href(%) {
|
||||
my %params = @_;
|
||||
my $href = $my_uri;
|
||||
|
||||
my @mapping = (
|
||||
project => "p",
|
||||
@@ -393,6 +398,19 @@ sub href(%) {
|
||||
|
||||
$params{'project'} = $project unless exists $params{'project'};
|
||||
|
||||
my ($use_pathinfo) = gitweb_check_feature('pathinfo');
|
||||
if ($use_pathinfo) {
|
||||
# use PATH_INFO for project name
|
||||
$href .= "/$params{'project'}" if defined $params{'project'};
|
||||
delete $params{'project'};
|
||||
|
||||
# Summary just uses the project path URL
|
||||
if (defined $params{'action'} && $params{'action'} eq 'summary') {
|
||||
delete $params{'action'};
|
||||
}
|
||||
}
|
||||
|
||||
# now encode the parameters explicitly
|
||||
my @result = ();
|
||||
for (my $i = 0; $i < @mapping; $i += 2) {
|
||||
my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
|
||||
@@ -400,7 +418,9 @@ sub href(%) {
|
||||
push @result, $symbol . "=" . esc_param($params{$name});
|
||||
}
|
||||
}
|
||||
return "$my_uri?" . join(';', @result);
|
||||
$href .= "?" . join(';', @result) if scalar @result;
|
||||
|
||||
return $href;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user