summaryrefslogtreecommitdiff
path: root/git/repo/base.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * Update base.pySam Bull2017-10-301-1/+1
| |
* | Merge pull request #686 from jeblair/issue-605Sebastian Thiel2017-11-021-2/+10
|\ \ | | | | | | Only gc.collect() under windows
| * | Only gc.collect() under windowsJames E. Blair2017-10-091-2/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | Under Windows, tempfile objects are holding references to open files until the garbage collector closes them and frees them. Explicit calls to gc.collect() were added to the finalizer for the Repo class to force them to be closed synchronously. However, this is expensive, especially in large, long-running programs. As a temporary measure to alleviate the performance regression on other platforms, only perform these calls when running under Windows. Fixes #553
* | Converting path in clone and clone_from to str before any other operation in ↵Mikuláš Poul2017-10-071-0/+4
|/ | | | case eg pathlib.Path is passed
* Keeping env values passed to `clone_from`Piotr Babij2017-09-301-1/+5
|
* Merge pull request #654 from vathpela/worktreesSebastian Thiel2017-09-281-4/+18
|\ | | | | worktrees: make non-packed refs also work correctly.
| * worktrees: make non-packed refs also work correctly.Peter Jones2017-08-221-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out aec58a9 did the right thing for /packed/ refs, but didn't work correctly on /unpacked/ refs. So this patch gives unpacked refs the same treatment. Without the fix here, the test added will cause this traceback: ====================================================================== ERROR: Check that we find .git as a worktree file and find the worktree ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pjones/devel/github.com/GitPython/git/test/lib/helper.py", line 92, in wrapper return func(self, path) File "/home/pjones/devel/github.com/GitPython/git/test/test_repo.py", line 938, in test_git_work_tree_dotgit self.assertIsInstance(repo.heads['aaaaaaaa'], Head) File "/home/pjones/devel/github.com/GitPython/git/util.py", line 893, in __getitem__ raise IndexError("No item found with id %r" % (self._prefix + index)) IndexError: No item found with id 'aaaaaaaa' Woops. Things I've learned: - test_remote doesn't work currently if you start on a branch. I think it never did? - Because of 346424da, all *sorts* of stuff in the test suite doesn't work if you name your development branch "packed-refs" (This seems like a bug...) Signed-off-by: Peter Jones <pjones@redhat.com>
* | Merge branch 'master' of https://github.com/Plazmaz/GitPython into ↵Sebastian Thiel2017-09-281-5/+17
|\ \ | | | | | | | | | Plazmaz-master
| * | Fixed missing parameter and changed nameDylan Katz2017-08-241-14/+16
| | |
| * | Fix leaking environment variablesDylan Katz2017-08-211-6/+18
| |/
* | util: move expand_path from repo/base and use it in Git class initAlexis Horgix Chotard2017-08-251-8/+4
|/
* Repo: handle worktrees betterPeter Jones2017-07-011-3/+8
| | | | | | | | | | | | | This makes Repo("foo") work when foo/.git is a file of the form created by "git worktree add", i.e. it's a text file that says: gitdir: /home/me/project/.git/worktrees/bar and where /home/me/project/.git/ is the nominal gitdir, but /home/me/project/.git/worktrees/bar has this worktree's HEAD etc and a "gitdir" file that contains the path of foo/.git . Signed-off-by: Peter Jones <pjones@redhat.com>
* Handle non-deterministic __del__ in RepoSebastian Thiel2017-04-091-1/+4
| | | | Fixes #610
* so minor that wasn't even worth my time typing this commentYaroslav Halchenko2017-04-041-1/+1
|
* Spelling fixesVille Skyttä2017-03-091-7/+7
|
* Document the use of next to throw an exception when hitting EOFGeorge Hickman2017-03-071-1/+1
|
* Ignore all lines of subsequent hunks until last one is foundGeorge Hickman2017-03-071-5/+8
| | | | | | | Git version 2.11.1+ introduced extra lines into the subsequent hunk sections for incremental blame output. The documentation notes that parsers of this output should ignore all lines between the start and end for robust parsing.
* Merge branch 'git_work_tree' of https://github.com/tbhartman/GitPython into ↵Sebastian Thiel2017-02-251-1/+1
|\ | | | | | | tbhartman-git_work_tree
| * check for GIT_WORK_TREETimothy B. Hartman2017-02-241-1/+1
| |
* | Merge pull request #555 from ankostis/cntxtmmanSebastian Thiel2017-02-251-0/+14
|\ \ | |/ |/| Retrofit `repo` class as context-man to cleanup global mman on repo-delete
| * fix(leaks): repo context-man to cleanup global mman on repo-deleteKostis Anagnostopoulos2016-12-081-0/+14
| | | | | | | | Improve API for problems like #553.
* | DOC: minor typoRaphael Boidol2016-12-311-1/+1
| |
* | chore(repo): remove commentSebastian Thiel2016-12-081-1/+1
|/ | | | | | | As it does not appear to be the case. See https://github.com/gitpython-developers/GitPython/issues/547#issuecomment-257270026 [skip ci]
* fix(repo): Use GIT_DIR only if no repo-path givenKostis Anagnostopoulos2016-10-221-3/+5
| | | | FIX #535 according to Byron's comment: https://github.com/gitpython-developers/GitPython/issues/535#issuecomment-255522529
* Merge with latest branch 'exp_git_dir'Kostis Anagnostopoulos2016-10-191-23/+27
|\ | | | | | | | | | | | | Conflicts: git/repo/base.py git/repo/fun.py git/test/test_submodule.py
| * repo: minor code and doc correcions.Kostis Anagnostopoulos2016-10-191-13/+13
| | | | | | | | | | | | | | + Expansion of paths also `osp.normalize()` them. + Make Repo-fields --> class-fields to avoid initializations on construct. + Explain and rename `git.repo.fun.find_git_dir()` is for submodules (`find_submodule_git_dir()`).
| * FIX #535: expand also GIT_DIR var on Repo-constructKostis Anagnostopoulos2016-10-191-3/+7
| | | | | | | | + Ignore "empty" GIT_DIR vars. + Improve documentation on the constructor `path` parameter.
* | cygwin, #533: FIX submodules detection (~10TCs fixed)Kostis Anagnostopoulos2016-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | + Decygpath sm's `.git` file contents. + Polish another path in `git add`; actually no main-code changes, just a replace \-->/ on a relative(!) path to make cygwin-git to work. - REGRESSION `test_git_submodules_and_add_sm_with_new_commit` asks for user/email settings. - Cygwin TCs failing: - PY2: err: 2, fail: 1 - PY3: err: 2, fail: 1
* | src: reduce needless deps to `gitdb.util`Kostis Anagnostopoulos2016-10-161-19/+14
| |
* | src: import os.path as ospKostis Anagnostopoulos2016-10-161-24/+25
| |
* | cygwin, #533: Allow '/cygdrive/c/' paths on repo initKostis Anagnostopoulos2016-10-141-1/+6
| | | | | | | | | | | | - Cygwin TCs failing: - PY2: err: 13, fail: 2 - PY3: err: 12, fail: 2
* | cygwin, #533: Polish also --git-separate-dirKostis Anagnostopoulos2016-10-141-5/+8
| | | | | | | | | | | | - Cygwin TCs failing: - PY2: err: 13, fail: 3 - PY3: err: 12, fail: 3
* | cygwin, #533: Try to make it work with Cygwin's Git.Kostis Anagnostopoulos2016-10-141-45/+30
|/ | | | | | | | | + Make `Git.polish_url()` convert paths into Cygwin-friendly paths. + Add utility and soe TCs for funcs for detecting cygwin and converting abs-paths to `/cygdrive/c/...`. - Cygwin TCs failing: - PY2: err: 14, fail: 3 - PY3: err: 13, fail: 3
* daemon, #525: FIX remote urls in config-filesKostis Anagnostopoulos2016-10-121-1/+1
| | | | | | | | | | | | + Parse most remote & config-urls \-->/. + Used relative daemon-paths. + Use git-daemon PORT above 10k; on Windows all below need Admin rights. +FIXED git-daemon @with_rw_and_rw_remote_repo(): + test_base.test_with_rw_remote_and_rw_repo() PASS. + test_remote.test_base() now freezes! (so still hidden win_err) + repo_test: minor finally delete test-repos created inside this repo. + util: delete unused `absolute_project_path()`.
* repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedirKostis Anagnostopoulos2016-10-121-40/+12
| | | | + Do not abspath twice when contructing cloned repo. + Add `git.repo.base` logger.
* io: Wrap (probably) allconfig_writers in `with` blocksKostis Anagnostopoulos2016-10-041-4/+2
|
* FIX regression by #519 on reading stdout/stderr of cmdsKostis Anagnostopoulos2016-10-021-2/+6
|
* Win, #519: FIX repo TCs.Kostis Anagnostopoulos2016-10-011-6/+2
| | | | | | | | | | | | | | | + FIX TestRepo.test_submodule_update(): + submod: del `.git` file prior overwrite; Windows denied otherwise! + FIX TestRepo.test_untracked_files(): + In the `git add <file>` case, it failed with unicode args on PY2. Had to encode them with `locale.getpreferredencoding()` AND use SHELL. + cmd: add `shell` into `execute()` kwds, for overriding USE_SHELL per command. + repo: replace blocky `communicate()` in `_clone()` with thread-pumps. + test_repo.py: unittestize (almost all) assertions. + Replace open --> with open for index (base and TC). + test_index.py: Enabled a dormant assertion.
* repo-TCs, #519: FIX config resource leaksKostis Anagnostopoulos2016-10-011-12/+6
| | | | | | + Modify lock/read-config-file code to ensure files closed. + Use `with GitConfigarser()` more systematically in TCs. + Clear any locks left hanging from prev Tcs. + Util: mark lock-files as SHORT_LIVED; save some SSDs...
* src: constify is_<platform>() callsKostis Anagnostopoulos2016-09-281-2/+2
| | | + TCs: unittest-asserts for git-tests.
* src, #519: collect all is_<platform>() callsKostis Anagnostopoulos2016-09-271-3/+4
|
* fix(repo): make it serializable with pickleSebastian Thiel2016-09-111-1/+0
| | | | | | | It's entirely untested if this repo still does the right thing, but I'd think it does. Fixes #504
* use $GIT_DIR when setPiotr Gaczkowski2016-08-171-1/+1
|
* Merge pull request #496 from haizaar/masterSebastian Thiel2016-08-021-4/+7
|\ | | | | is_dirty supports path. Fixes #482.
| * is_dirty supports path. Fixes #482.Zaar Hai2016-08-011-4/+7
| |
* | fix(blame): lazily fetch full commit messageSebastian Thiel2016-07-171-4/+2
|/ | | | | | | | | | That way, we will not only get the summary line contained in the blame, but fetch the full message. This is more costly than the previous implementation allowed it to be, but being less surprising/correct certainly is the preferred behaviour here. Fixes #485
* fix(repo): prevent error messages from being swallowedSebastian Thiel2016-06-131-1/+2
| | | | | | | This issue must have rosen from `to_progress_instance()` being inserted in a spot where `None` was a legit value. Fixes #462
* chore(misc): cleanup and docsSebastian Thiel2016-05-291-2/+2
| | | | | | Minor adjustments to PR to match current code style. Related to #450
* The progress arg to push, pull, fetch and clone is now a python callable.Barry Scott2016-05-281-1/+4
| | | | | | | | | | | | | This simplifies the API and removes the parser, RemoteProgres, from the API as RemoteProgress is an internal detail of the implementation. progress is accepted as: * None - drop progress messages * callable (function etc) - call the function with the same args as update * object - assume its RemoteProgress derived as use as before RemoteProgress takes an optional progress_function argument. It will call the progress function if not None otherwise call self.update as it used to.
* Ignore trailing last empty string in .split() outputVincent Driessen2016-05-241-4/+1
|