summaryrefslogtreecommitdiff
path: root/t/t3700-add.sh
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'maint'Junio C Hamano2009-06-221-1/+1
|\ | | | | | | | | * maint: t3700-add: add a POSIXPERM prerequisite to a new test
| * t3700-add: add a POSIXPERM prerequisite to a new testJohannes Sixt2009-06-221-1/+1
| | | | | | | | | | | | | | | | The new test does a 'chmod 0', which does not have the intended effect on Windows. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge branch 'sb/maint-1.6.0-add-config-fix' into maintJunio C Hamano2009-06-221-0/+13
| |\ | | | | | | | | | | | | * sb/maint-1.6.0-add-config-fix: add: allow configurations to be overriden by command line
* | \ Merge branch 'sb/maint-1.6.0-add-config-fix'Junio C Hamano2009-06-201-0/+13
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | * sb/maint-1.6.0-add-config-fix: add: allow configurations to be overriden by command line use xstrdup, not strdup in ll-merge.c Conflicts: builtin-add.c
| * | add: allow configurations to be overriden by command lineStephen Boyd2009-06-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't call git_config after parsing the command line options, otherwise the config settings will override any settings made by the command line. This can be seen by setting add.ignore_errors and then specifying --no-ignore-errors when using git-add. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-add: no need for -f when resolving a conflict in already tracked pathJeff King2009-05-311-0/+12
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a path F that matches ignore pattern has a conflict, "git add F" insisted the -f option be given, which did not make sense. It would have required -f when the path was originally added, but when resolving a conflict, it already is tracked. So this should work (and does): $ echo file >.gitignore $ echo content >file $ git add -f file ;# need -f because we are adding new path $ echo more content >>file $ git add file ;# don't need -f; it is not actually an "other" file This is handled under the hood by the COLLECT_IGNORED option to read_directory. When that code finds an ignored file, it checks the index to make sure it is not actually a tracked file. However, the test it uses does not take into account unmerged entries, and considers them to still be ignored. "git ls-files" uses a more elaborate test and gets the right answer and the same test should be used here. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t3700: Skip a test with backslashes in pathspecJohannes Sixt2009-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | The test verifies that glob special characters can be escaped with backslashes. In particular, the string fo\[ou\]bar is given to git. On Windows, this does not work because backslashes are first of all directory separators, and first thing git does with a pathspec from the command line is to convert backslashes to forward slashes. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
* | Skip tests that require a filesystem that obeys POSIX permissionsJohannes Sixt2009-03-221-4/+4
| | | | | | | | Signed-off-by: Johannes Sixt <j6t@kdbg.org>
* | Use prerequisite tags to skip tests that depend on symbolic linksJohannes Sixt2009-03-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many tests depend on that symbolic links work. This introduces a check that sets the prerequisite tag SYMLINKS if the file system supports symbolic links. Since so many tests have to check for this prerequisite, we do the check in test-lib.sh, so that we don't need to repeat the test in many scripts. To check for 'ln -s' failures, you can use a FAT partition on Linux: $ mkdosfs -C git-on-fat 1000000 $ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt Clone git to /mnt and $ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7 t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \ make test (These additionally skipped tests depend on POSIX permissions that FAT on Linux does not provide.) Signed-off-by: Johannes Sixt <j6t@kdbg.org>
* | tests: grep portability fixesJeff King2008-09-301-1/+1
|/ | | | | | | | | | | | | | | | | | | | We try to avoid using the "-q" or "-e" options, as they are largely useless, as explained in aadbe44f. There is one exception for "-e" here, which is in t7701 used to produce an "or" of patterns. This can be rewritten as an egrep pattern. This patch also removes use of "grep -F" in favor of the more widely available "fgrep". [sp: Tested on AIX 5.3 by Mike Ralphson, Tested on MinGW by Johannes Sixt] Signed-off-by: Jeff King <peff@peff.net> Tested-by: Mike Ralphson <mike@abacus.co.uk> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix t3700 on filesystems which do not support question marks in namesAlex Riesen2008-08-151-4/+4
| | | | | | | | | | Use square brackets instead. And the prominent example of the deficiency are, as usual, the filesystems of Microsoft house. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2008-08-131-0/+8
|\ | | | | | | | | | | * maint: t5304-prune: adjust file mtime based on system time rather than file mtime Fix escaping of glob special characters in pathspecs
| * Fix escaping of glob special characters in pathspecsKevin Ballard2008-08-131-0/+8
| | | | | | | | | | | | | | | | | | | | match_one implements an optimized pathspec match where it only uses fnmatch if it detects glob special characters in the pattern. Unfortunately it didn't treat \ as a special character, so attempts to escape a glob special character would fail even though fnmatch() supports it. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/: Use "test_must_fail git" instead of "! git"Stephan Beyer2008-07-131-2/+2
|/ | | | | | | | | | | | | | | This patch changes every occurrence of "! git" -- with the meaning that a git call has to gracefully fail -- into "test_must_fail git". This is useful to - make sure the test does not fail because of a signal, e.g. SIGSEGV, and - advertise the use of "test_must_fail" for new tests. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ar/add-unreadable'Junio C Hamano2008-05-211-0/+43
|\ | | | | | | | | | | | | | | | | * ar/add-unreadable: Add a config option to ignore errors for git-add Add a test for git-add --ignore-errors Add --ignore-errors to git-add to allow it to skip files with read errors Extend interface of add_files_to_cache to allow ignore indexing errors Make the exit code of add_file_to_index actually useful
| * Add a config option to ignore errors for git-addAlex Riesen2008-05-121-0/+21
| | | | | | | | | | Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Add a test for git-add --ignore-errorsAlex Riesen2008-05-121-0/+22
| | | | | | | | | | Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | fix bsd shell negationJeff King2008-05-131-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | On some shells (notably /bin/sh on FreeBSD 6.1), the construct foo && ! bar | baz is true if foo && baz whereas for most other shells (such as bash) is true if foo && ! baz We can work around this by specifying foo && ! (bar | baz) which works everywhere. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix per-directory exclude handing for "git add"Junio C Hamano2007-11-161-0/+24
| | | | | | | | | | | | | | | | | | | In "dir_struct", each exclusion element in the exclusion stack records a base string (pointer to the beginning with length) so that we can tell where it came from, but this pointer is just pointing at the parameter that is given by the caller to the push_exclude_per_directory() function. While read_directory_recursive() runs, calls to excluded() makes use the data in the exclusion elements, including this base string. The caller of read_directory_recursive() is not supposed to free the buffer it gave to push_exclude_per_directory() earlier, until it returns. The test case Bruce Stephens gave in the mailing list discussion was simplified and added to the t3700 test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-add: Add support for --refresh option.Alexandre Julliard2007-08-131-0/+12
| | | | | | | | This allows to refresh only a subset of the project files, based on the specified pathspecs. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix bogus use of printf in t3700 testJunio C Hamano2007-08-031-2/+2
| | | | | | | | The hashed contents did not matter in the end result, but it passed an uninitialized variable to printf, which caused it to emit empty while giving an error/usage message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rewrite "git-frotz" to "git frotz"Junio C Hamano2007-07-021-35/+35
| | | | | | This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Test 'git add' for unmerged entries when core.symlinks=false.Johannes Sixt2007-07-021-10/+17
| | | | | | | | | | In 20314271679e169f324c118c69c8d9e0399feec9 git add was fixed if unmerged entries are in the index and core.filemode=false. core.symlinks=false is a similar case, which touches the same code path. Here is a test that makes sure that the symlink property in the index is preserved, too. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git add: respect core.filemode with unmerged entriesJohannes Schindelin2007-07-011-0/+26
| | | | | | | | | | | When a merge left unmerged entries, git add failed to pick up the file mode from the index, when core.filemode == 0. If more than one unmerged entry is there, the order of stage preference is 2, 1, 3. Noticed by Johannes Sixt. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* dir.c(common_prefix): Fix two bugsJohannes Schindelin2007-04-231-0/+6
| | | | | | | | | | | | | | | | | The function common_prefix() is used to find the common subdirectory of a couple of pathnames. When checking if the next pathname matches up with the prefix, it incorrectly checked the whole path, not just the prefix (including the slash). Thus, the expensive part of the loop was executed always. The other bug is more serious: if the first and the last pathname in the list have a longer common prefix than the common prefix for _all_ pathnames in the list, the longer one would be chosen. This bug was probably hidden by the fact that bash's wildcard expansion sorts the results, and the code just so happens to work with sorted input. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not take mode bits from index after type change.Junio C Hamano2007-02-161-0/+20
| | | | | | | | | | | | | When we do not trust executable bit from lstat(2), we copied existing ce_mode bits without checking if the filesystem object is a regular file (which is the only thing we apply the "trust executable bit" business) nor if the blob in the index is a regular file (otherwise, we should do the same as registering a new regular file, which is to default non-executable). Noticed by Johannes Sixt. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Rename git-repo-config to git-config.Tom Prince2007-01-281-3/+3
| | | | | Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix 'git add' with .gitignoreJunio C Hamano2006-12-291-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | When '*.ig' is ignored, and you have two files f.ig and d.ig/foo in the working tree, $ git add . correctly ignored f.ig but failed to ignore d.ig/foo. This was caused by a thinko in an earlier commit 4888c534, when we tried to allow adding otherwise ignored files. After reverting that commit, this takes a much simpler approach. When we have an unmatched pathspec that talks about an existing pathname, we know it is an ignored path the user tried to add, so we include it in the set of paths directory walker returned. This does not let you say "git add -f D" on an ignored directory D and add everything under D. People can submit a patch to further allow it if they want to, but I think it is a saner behaviour to require explicit paths to be spelled out in such a case. Signed-off-by: Junio C Hamano <junkio@cox.net>
* trust-executable-bit: fix breakage for symlinksJunio C Hamano2006-11-221-2/+12
| | | | | | | | | | An earlier commit f28b34a broke symlinks when trust-executable-bit is not set because it incorrectly assumed that everything was a regular file. Reported by Juergen Ruehle. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Corrected copy-and-paste thinko in ignore executable bit test case.Shawn Pearce2006-09-271-1/+1
| | | | | | | | This test should be testing update-index --add, not git-add as the latter is implemented in terms of the former. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Ignore executable bit when adding files if filemode=0.Shawn Pearce2006-09-261-0/+22
| | | | | | | | | | | | | | If the user has configured core.filemode=0 then we shouldn't set the execute bit in the index when adding a new file as the user has indicated that the local filesystem can't be trusted. This means that when adding files that should be marked executable in a repository with core.filemode=0 the user must perform a 'git update-index --chmod=+x' on the file before committing the addition. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-add: Add support for --, documentation, and test.Carl Worth2006-02-211-0/+22
This adds support to git-add to allow the common -- to separate command-line options and file names. It adds documentation and a new git-add test case as well. [jc: this should apply to 1.2.X maintenance series, so I reworked git-ls-files --error-unmatch test. ] Signed-off-by: Junio C Hamano <junkio@cox.net>