Commit Graph

4455 Commits

Author SHA1 Message Date
Philip Kelley
cb53669e14 Rename function to __ prefix 2013-03-01 16:38:13 -05:00
Philip Kelley
47f70846aa Merge pull request #1379 from arrbee/fix-tests-with-autocrlf-input-on-windows
Control for core.autocrlf during testing
2013-03-01 13:27:46 -08:00
Philip Kelley
3f0d0c85d0 Disable ignore_case when writing the index to a tree 2013-03-01 15:46:21 -05:00
Russell Belfer
7d46b34baf Control for core.autocrlf during testing 2013-03-01 12:26:05 -08:00
Vicent Martí
426b2e2fce Merge pull request #1378 from jamill/clone_no_delete
Clone should not clean up directories it did not create
2013-03-01 12:10:06 -08:00
Jameson Miller
926acbcf8e Clone should not delete directories it did not create 2013-03-01 14:56:09 -05:00
Vicent Martí
cc427158d4 Merge pull request #1373 from arrbee/why-cdecl-why
Why cdecl why?
2013-02-28 15:09:32 -08:00
Russell Belfer
f443a72d33 Fix some deprecation warnings on Windows
This fixes some snprintf and vsnprintf related deprecation
warnings we've been having on Windows with recent compilers.
2013-02-28 14:41:26 -08:00
Russell Belfer
97b7137459 Add GIT_STDLIB_CALL
This removes the one-off GIT_CDECL and adds a new standard way of
doing this named GIT_STDLIB_CALL with a src/win32 specific def
when on the Windows platform.
2013-02-28 14:14:45 -08:00
Vicent Marti
5fa8abb868 w32-posix: Wrap the timezone declaration with a clause
Allows compilation in newer versions of MinGW that already defined it.
2013-02-28 17:36:20 +01:00
Russell Belfer
f708c89fa6 fixing some warnings on Windows 2013-02-27 15:15:39 -08:00
Russell Belfer
11b5beb7ba use cdecl for hashsig sorting functions on Windows 2013-02-27 15:07:28 -08:00
Vicent Martí
e68e33f33d Merge pull request #1233 from arrbee/file-similarity-metric
Add file similarity scoring to diff rename/copy detection
2013-02-27 14:50:32 -08:00
Russell Belfer
9f9477d650 Merge pull request #1372 from ethomson/checkout_workdir_end
don't dereference at the end of the workdir iterator
2013-02-27 14:21:41 -08:00
Russell Belfer
18f0826408 Make mode handling during init more like git
When creating files, instead of actually using GIT_FILEMODE_BLOB
and the other various constants that happen to correspond to
mode values, apparently I should be just using 0666 and 0777, and
relying on the umask to clear bits and make the value sane.

This fixes the rules for copying a template directory and fixes
the checks to match that new behavior.  (Further changes to the
checkout logic to follow separately.)
2013-02-27 13:44:15 -08:00
Edward Thomson
395509ffcd don't dereference at the end of the workdir iterator 2013-02-27 15:35:52 -06:00
Vicent Martí
c493f8211f Merge pull request #1371 from csware/version-constants
Win32: Use constants in version resource definitions where possible
2013-02-27 11:01:16 -08:00
Sven Strickroth
82ac1f7678 Win32: Use constants in version resource definitions where possible
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-02-27 19:48:02 +01:00
Russell Belfer
0d1b094b07 Fix portability issues on Windows
The new tests were not taking core.filemode into account when
testing file modes after repo initialization.  Fixed that and some
other Windows warnings that have crept in.
2013-02-26 13:15:06 -08:00
Russell Belfer
3c42e4ef74 Fix initialization of repo directories
When PR #1359 removed the hooks from the test resources/template
directory, it made me realize that the tests for
git_repository_init_ext using templates must be pretty shabby
because we could not have been testing if the hooks were getting
created correctly.

So, this started with me recreating a couple of hooks, including
a sample and symlink, and adding tests that they got created
correctly in the various circumstances, including with the SHARED
modes, etc.  Unfortunately this uncovered some issues with how
directories and symlinks were copied and chmod'ed.  Also, there
was a FIXME in the code related to the chmod behavior as well.

Going back over the directory creation logic for setting up a
repository, I found it was a little difficult to read and could
result in creating and/or chmod'ing directories that the user
almost certainly didn't intend.

So that let to this work which makes repo initialization much
more careful (and hopefully easier to follow).  It required a
couple of extensions / changes to core fileops utilities, but I
also think those are for the better, at least for git_futils_cp_r
in terms of being careful about what actions it takes.
2013-02-26 11:43:14 -08:00
Vicent Martí
6990377786 Merge pull request #1368 from scunz/inc_ref
Increment reference counter in git_repository_set_config
2013-02-26 09:29:27 -08:00
Sascha Cunz
25e7c9b7a6 Increment reference counter in git_repository_set_config
This fixes #1365
2013-02-26 18:21:03 +01:00
Edward Thomson
3e212548f8 Merge pull request #1364 from martinwoodward/thank-martin
Give props to Martin Pool
2013-02-26 07:06:42 -08:00
Martin Woodward
5c46937b3a Give props to Martin Pool
Martin Pool was the original author of the code referenced in the clone
example. Make note that he's given his permission and also give him the
proper credit.
2013-02-26 09:00:37 +00:00
Michael Schubert
8005c6d420 Revert "hash: remove git_hash_init from internal api"
This reverts commit efe7fad6c9, except for
the indentation fixes.
2013-02-26 01:08:34 +01:00
Vicent Martí
f657688bc7 Merge pull request #1363 from schu/hash-initialization
hash: remove git_hash_init from internal api
2013-02-25 15:41:56 -08:00
Michael Schubert
efe7fad6c9 hash: remove git_hash_init from internal api
Along with that, fix indentation in tests-clar/object/raw/hash.c
2013-02-26 00:23:00 +01:00
Michael Schubert
be225be785 tests/pack: fixup 6774b10
Initialize the hash ctx with git_hash_ctx_init, not git_hash_init.
2013-02-25 23:36:25 +01:00
Vicent Martí
989abe9be4 Merge pull request #1362 from schu/packbuilder-nits
packbuilder: minor improvements
2013-02-25 14:03:42 -08:00
Michael Schubert
6774b1071f tests/pack: do strict check of testpack's SHA1 hash 2013-02-25 22:22:15 +01:00
Michael Schubert
fcc265fef8 pack.h: improve docs on how to create a packfile 2013-02-25 22:22:15 +01:00
Vicent Martí
25a0831f2d Merge pull request #1359 from martinwoodward/remove-sample-hooks
Remove sample hook files
2013-02-25 09:07:45 -08:00
Martin Woodward
fc6c5b5001 Remove sample hook files
Getting rid of sample hook files from test repos as they just take up
space with no value.
2013-02-25 17:03:05 +00:00
Vicent Martí
5eeb357df8 Merge pull request #1355 from phkelley/development
Portability fixes for Solaris
2013-02-23 03:39:11 -08:00
Vicent Martí
68fec637a2 Merge pull request #1356 from arrbee/fix-directory-as-ignore-file
Do not fail if .gitignore is directory
2013-02-22 12:26:01 -08:00
Russell Belfer
37d9168608 Do not fail if .gitignore is directory
This is designed to fix libgit2sharp #350 where if .gitignore is
a directory we abort all operations that process ignores instead
of just skipping it as core git does.

Also added test that fails without this change and passes with it.
2013-02-22 12:21:54 -08:00
Russell Belfer
1be4ba9842 More rename detection tests
This includes tests for crlf changes, whitespace changes with the
default comparison and with the ignore whitespace comparison, and
more sensitivity checking for the comparison code.
2013-02-22 11:13:01 -08:00
Philip Kelley
7beeb3f420 Rename 'exp' so it doesn't conflict with exp() 2013-02-22 14:03:44 -05:00
Russell Belfer
0a0089131f Minor improvements to find_similar code
This moves a couple of checks outside of the inner loop of the
find_similar rename/copy detection phase that are only dependent
on the "from" side of a detection.

Also, this replaces the inefficient initialization of the
options structure when a value is not provided explicitly by the
user.
2013-02-22 10:21:02 -08:00
Russell Belfer
f827589067 Replace static data with configured metric
Instead of creating three git_diff_similarity_metric statically
for the various config options, just create the metric structure
on demand and populate it, using the payload to specific the
extra flags that should be passed to the hashsig.  This removes
a level of obfuscation from the code, I think.
2013-02-22 10:19:50 -08:00
Russell Belfer
6f9d5ce818 Fix tests for find_similar and related
This fixes both a test that I broke in diff::patch where I was
relying on the current state of the working directory for the
renames test data and fixes an unstable test in diff::rename
where the environment setting for the "diff.renames" config was
being allowed to influence the test results.
2013-02-22 10:17:08 -08:00
Vicent Martí
06eaa06f26 Merge pull request #1343 from nulltoken/topic/remote_orphaned_branch
Teach git_branch_remote_name() to work with orphaned heads
2013-02-22 09:48:47 -08:00
Vicent Martí
698bf1da0e Merge pull request #1354 from nulltoken/fix/stash-drop
Fix git_stash_drop()
2013-02-22 09:48:34 -08:00
Philip Kelley
6c72035fbc Portability fixes for Solaris 2013-02-22 12:23:14 -05:00
nulltoken
bbc53e4f93 branch: refactor git_branch_remote_name() tests 2013-02-22 17:04:25 +01:00
nulltoken
c1b5e8c42b branch: Make git_branch_remote_name() cope with orphaned heads 2013-02-22 17:04:23 +01:00
nulltoken
9ccab8dfb8 stash: Update the reference when dropping the topmost stash 2013-02-22 15:25:59 +01:00
nulltoken
39bcb4deb8 stash: Refactor stash::drop tests 2013-02-22 15:25:58 +01:00
nulltoken
d788499a10 ignore: enhance git_ignore_path_is_ignored() test coverage 2013-02-22 15:25:57 +01:00
Russell Belfer
d4b747c1cb Add diff rename tests with partial similarity
This adds some new tests that actually exercise the similarity
metric between files to detect renames, copies, and split modified
files that are too heavily modified.

There is still more testing to do - these tests are just partially
covering the cases.

There is also one bug fix in this where a change set with only
MODIFY being broken into ADD/DELETE (due to low self-similarity)
without any additional RENAMED entries would end up not processing
the split requests (because the num_rewrites counter got reset).
2013-02-21 16:44:44 -08:00