Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Tue, 24 Apr 2007 07:08:16 +0000 (00:08 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 24 Apr 2007 07:08:16 +0000 (00:08 -0700)
* maint:
  Documentation/git-reset.txt: suggest git commit --amend in example.
  Build RPM with ETC_GITCONFIG=/etc/gitconfig
  Ignore all man sections as they are generated files.
  Fix typo in git-am: s/Was is/Was it/
  Reverse the order of -b and --track in the man page.
  dir.c(common_prefix): Fix two bugs

Conflicts:

git.spec.in

Documentation/.gitignore
Documentation/git-checkout.txt
Documentation/git-reset.txt
dir.c
git-am.sh
git.spec.in
t/t3700-add.sh

index b98d21e98e008c79d2598c6aa9213826d26f5b0d..a37b2152bd26be2c2289e1f57a292534a51a93c7 100644 (file)
@@ -1,7 +1,6 @@
 *.xml
 *.html
-*.1
-*.7
+*.[1-8]
 *.made
 howto-index.txt
 doc.dep
index 4f2e847dc3fe44f503a578fc79496179c21ac11a..918d8ee720a573f91ec6efa654da5c2cdc05d7b0 100644 (file)
@@ -8,7 +8,7 @@ git-checkout - Checkout and switch to a branch
 SYNOPSIS
 --------
 [verse]
-'git-checkout' [-q] [-f] [-b [--track | --no-track] <new_branch> [-l]] [-m] [<branch>]
+'git-checkout' [-q] [-f] [[--track | --no-track] -b <new_branch> [-l]] [-m] [<branch>]
 'git-checkout' [<tree-ish>] <paths>...
 
 DESCRIPTION
index 5b55cda512bbdb507486ac5d0db0d28e32b1dcb1..19c5b9bbda60744723e453dceaa209c47a49cb60 100644 (file)
@@ -67,6 +67,8 @@ message, or both.  Leaves working tree as it was before "reset".
 <3> "reset" copies the old head to .git/ORIG_HEAD; redo the
 commit by starting with its log message.  If you do not need to
 edit the message further, you can give -C option instead.
++
+See also the --amend option to gitlink:git-commit[1].
 
 Undo commits permanently::
 +
diff --git a/dir.c b/dir.c
index 6564a929ff66cdffca0666e175c9361149b25b5e..d3063520b03c9c5f608cbd9e97f6b414adb4c5af 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -34,8 +34,9 @@ int common_prefix(const char **pathspec)
        prefix = slash - path + 1;
        while ((next = *++pathspec) != NULL) {
                int len = strlen(next);
-               if (len >= prefix && !memcmp(path, next, len))
+               if (len >= prefix && !memcmp(path, next, prefix))
                        continue;
+               len = prefix - 1;
                for (;;) {
                        if (!len)
                                return 0;
index e69ecbfdb1a817b477aff8618f284a4c921e00e5..c9f66e278454374714794477be7ff8b93cd05a0f 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -291,7 +291,7 @@ do
                        <"$dotest/$msgnum" >"$dotest/info" ||
                        stop_here $this
                test -s $dotest/patch || {
-                       echo "Patch is empty.  Was is split wrong?"
+                       echo "Patch is empty.  Was it split wrong?"
                        stop_here $this
                }
                git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
index f0746ed78c79739885ca9c32af27d3ee9ed4a974..556bdda7aa2ec7a99c7668390c60cdc69eed74f5 100644 (file)
@@ -96,12 +96,14 @@ Perl interface to Git
 
 %build
 make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" WITH_P4IMPORT=YesPlease \
+     ETC_GITCONFIG=/etc/gitconfig \
      prefix=%{_prefix} PYTHON_PATH=%{python_path} all %{!?_without_docs: doc}
 
 %install
 rm -rf $RPM_BUILD_ROOT
 make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \
      WITH_P4IMPORT=YesPlease prefix=%{_prefix} mandir=%{_mandir} \
+     ETC_GITCONFIG=/etc/gitconfig \
      PYTHON_PATH=%{python_path} \
      INSTALLDIRS=vendor install %{!?_without_docs: install-doc}
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
index 08e035220cfd5c2da0798eba84c779981f185b4a..ad8cc7d4ae88e2066d2f51b6a6a5a192780d5e9a 100755 (executable)
@@ -104,4 +104,10 @@ test_expect_success 'add ignored ones with -f' '
        git-ls-files --error-unmatch d.ig/d.if d.ig/d.ig
 '
 
+mkdir 1 1/2 1/3
+touch 1/2/a 1/3/b 1/2/c
+test_expect_success 'check correct prefix detection' '
+       git add 1/2/a 1/3/b 1/2/c
+'
+
 test_done