Commit Graph

4004 Commits

Author SHA1 Message Date
Russell Belfer
546d65a8da Fix up spoolandsort iterator usage
The spoolandsort iterator changes got sort-of cherry picked out of
this branch and so I dropped the commit when rebasing; however,
there were a few small changes that got dropped as well (since the
version merged upstream wasn't quite the same as what I dropped).
2013-01-04 15:47:43 -08:00
Russell Belfer
a9a730075e Submodule caching fix and location API
This adds a new API to the submodule interface that just returns
where information about the submodule was found (e.g. config file
only or in the HEAD, index, or working directory).

Also, the old "refresh" call was potentially keeping some stale
submodule data around, so this simplfies that code and literally
discards the old cache, then reallocates.
2013-01-04 15:47:43 -08:00
Russell Belfer
6f58332f3a Fix use of uninitialized variable 2013-01-04 15:47:43 -08:00
Russell Belfer
a6a82e1a59 Improve error propagation in stash
Stash was sometimes obscuring the actual error code, replacing it
with a -1 when there was more descriptive value.  This updates
stash to preserve the original error code more reliably along
with a variety of other error handling tweaks.

I believe this is an improvement, but arguably, preserving the
underlying error code may result in values that are harder to
interpret by the caller who does not understand the internals.
Discussion is welcome!
2013-01-04 15:47:42 -08:00
Russell Belfer
8fe713ccf7 Make git_oid_tostr use out buffer for NULL oid
Previously a NULL oid was handled like an empty buffer and
returned a status empty string.  This makes git_oid_tostr()
set the output buffer to the empty string instead.
2013-01-04 15:47:42 -08:00
Russell Belfer
5cf9875a4f Add index updating to checkout
Make checkout update entries in the index for all files that are
updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX
is given.  To do this, iterators were extended to allow a little
more introspection into the index being iterated over, etc.
2013-01-04 15:47:42 -08:00
Russell Belfer
7e5c8a5b41 More checkout improvements
This flips checkout back to be driven off the changes between
the baseline and the target trees.  This reinstates the complex
code for tracking the contents of the working directory, but
overall, I think the resulting logic is easier to follow.
2013-01-04 15:47:42 -08:00
Russell Belfer
cf20803170 Rework checkout internals (again)
I've tried to map out the detailed behaviors of checkout and make
sure that we're handling the various cases correctly, along with
providing options to allow us to emulate "git checkout" and "git
checkout-index" with the various flags.  I've thrown away flags
in the checkout API that seemed like clutter and added some new
ones.  Also, I've converted the conflict callback to a general
notification callback so we can emulate "git checkout" output and
display "dirty" files.

As of this commit, the new behavior is not working 100% but some
of that is probably baked into tests that are not testing the
right thing.  This is a decent snapshot point, I think, along the
way to getting the update done.
2013-01-04 15:47:42 -08:00
Russell Belfer
bfe7d7de22 Reorder operations in git reset
This corrects the order of operations in git reset so that the
checkout to reset the working directory content is done before
the HEAD is moved.  This allows us to use the HEAD and the index
content to know what files can / should safely be reset.

Unfortunately, there are still some cases where the behavior of
this revision differs from core git.  Notable, a file which has
been added to the index but is not present in the HEAD is
considered to be tracked by core git (and thus removable by a
reset command) whereas since this loads the target state into
the index prior to resetting, it will consider such a file to be
untracked and won't touch it.  That is a larger fix that I'll
defer to a future commit.
2013-01-04 15:47:42 -08:00
Jameson Miller
c5df10f4aa Failing test on git_checkout_tree when removing directories 2013-01-04 15:23:47 -08:00
Marvin Gülker
d0951175d4 Add failing test to demonstrate wrong checkout behaviour 2013-01-04 15:23:47 -08:00
Russell Belfer
6fee906c98 missing error message is confusing 2013-01-04 15:23:47 -08:00
Russell Belfer
6ac724afbe Clear error to avoid leaving invalid error behind 2013-01-04 15:23:47 -08:00
Russell Belfer
e9e20c8474 Update cl_git_pass to return more info
This adds a failure reporting function that is called by
cl_git_pass which captures the actual error return code and
the error message if available in the failure report.
2013-01-04 15:23:47 -08:00
Vicent Marti
6040616214 clar: lolpython 2013-01-04 20:28:33 +01:00
Vicent Marti
3a4a961da5 clar: Corrupted pickles 2013-01-04 20:25:57 +01:00
Vicent Martí
c18a5ec58c Merge pull request #1174 from nulltoken/topic/soft_reset_with_index_conflicts
Prevent soft reset when index contains conflicts
2013-01-04 11:10:39 -08:00
Carlos Martín Nieto
702c3bf70e clar: make it compatible with python3 2013-01-04 19:03:02 +00:00
Vicent Marti
1d5d418671 clar: haha 2013-01-04 20:02:01 +01:00
Vicent Marti
73b58c9159 clar: fix warning on Windows 2013-01-04 20:00:09 +01:00
nulltoken
bdb2f24223 Ignore clar.suite.rule 2013-01-04 19:54:45 +01:00
Philip Kelley
27fe6efe85 Fix git_index sorting with core.ignorecase in git_index_read 2013-01-04 13:48:08 -05:00
nulltoken
9a0d590412 reset: Cannot soft reset with a conflicted index 2013-01-04 18:43:34 +01:00
Vicent Martí
52ee071b35 Merge pull request #1189 from martinwoodward/tests-compliance
Add jGit license block to derrived tests
2013-01-04 09:33:54 -08:00
Martin Woodward
ba1a430a8b Add jGit license block to derrived tests
Add the jGit license block to tests derrived from jGit as per the
terms of the BSD license.
2013-01-04 17:29:45 +00:00
Vicent Marti
8978f1de0c Merge branch 'clar2' into development
Conflicts:
	src/pqueue.c
	src/pqueue.h
	src/util.c
	tests-clar/merge/setup.c
2013-01-04 17:53:45 +01:00
Vicent Marti
a7ffd936bf clar: fix merge/setup.c 2013-01-04 17:47:52 +01:00
Ted Nyman
d0ae8b98de Remove whitespace 2013-01-04 17:47:52 +01:00
Ted Nyman
ed8fb8210d Add note in CONVENTIONS about inlined functions 2013-01-04 17:47:51 +01:00
Martin Woodward
10aa44cee2 Add Brian Downing to the hall of fame 2013-01-04 17:47:51 +01:00
Edward Thomson
5a62d659bc MERGE_HEAD contents iterator 2013-01-04 17:47:51 +01:00
Martin Woodward
9651fdc297 Give proper license notice to code from Android
The usage of the Android derrived code contains a full notice
which must be provided with the source code as per the terms
given at:
https://android.googlesource.com/platform/bionic/+/android-4.0.3_r1.1/libc/bionic/dirname_r.c
2013-01-04 17:47:51 +01:00
Martin Woodward
43464497ab Add full license notice to bsearch code
The original BSD glibc code contains the notice as given at
http://opensource.apple.com/source/gcc/gcc-5666.3/libiberty/bsearch.c
and should be given in full along with the code.
2013-01-04 17:47:51 +01:00
Congyi Wu
d73d52dfcb Fix bug in gen_pktline() for deletes of missing remote refs
* gen_pktline() in smart_protocol.c was skipping refspecs that deleted
  refs that were not advertised by the server.  The new behavior is to
  send a delete command with an old-id of zero, which matches the behavior
  of the official git client.
* Update test_network_push__delete() in reaction to above fix.
* Obviate messy logic that handles missing push_spec rrefs by canonicalizing
  push_spec.  After calculate_work(), loid, roid, and rref, are filled in with
  exactly what is sent to the server
2013-01-04 17:47:51 +01:00
Martin Woodward
931b8b709c Add Apache license header back to libpqueue files
The original libpqueue file were licensed under Apache 2.0 so
therefore should retain their copyrights and header as per the
license terms at http://www.apache.org/licenses/LICENSE-2.0
2013-01-04 17:47:51 +01:00
Edward Thomson
35560d6d14 expose merge metadata cleanup 2013-01-04 17:47:51 +01:00
Nikolai Vladimirov
b60b4562fe add option to allow git note overwrite 2013-01-04 17:47:51 +01:00
Philip Kelley
853488eed4 Fix git__strncasecmp 2013-01-04 17:47:51 +01:00
Nikolai Vladimirov
b421decc76 notes.c - whitespace fix 2013-01-04 17:47:51 +01:00
Vicent Martí
686a243a73 Merge pull request #1184 from ethomson/mergehead_iterator
MERGE_HEAD contents iterator
2013-01-04 08:36:13 -08:00
Philip Kelley
37955f5401 Merge pull request #1183 from congyiwu/push_delete_fix
Fix bug in gen_pktline() for deletes of missing remote refs
2013-01-04 07:33:31 -08:00
Vicent Martí
acb0f65ff8 Merge pull request #1188 from tnm/inline-convention
Inline convention
2013-01-04 03:57:31 -08:00
Ted Nyman
f783f76efb Remove whitespace 2013-01-03 16:15:52 -08:00
Ted Nyman
394711ff75 Add note in CONVENTIONS about inlined functions 2013-01-03 16:14:23 -08:00
Vicent Martí
60d61926d3 Merge pull request #1187 from martinwoodward/give-props
Add Brian Downing to the hall of fame
2013-01-03 15:46:23 -08:00
Martin Woodward
c999e1c307 Add Brian Downing to the hall of fame 2013-01-03 23:42:04 +00:00
Vicent Martí
dccec59336 Merge pull request #1186 from martinwoodward/compliance-audit
License Compliance Audit
2013-01-03 14:46:45 -08:00
Edward Thomson
42e50b5ed1 MERGE_HEAD contents iterator 2013-01-03 16:35:59 -06:00
Martin Woodward
1c5b3a4185 Give proper license notice to code from Android
The usage of the Android derrived code contains a full notice
which must be provided with the source code as per the terms
given at:
https://android.googlesource.com/platform/bionic/+/android-4.0.3_r1.1/libc/bionic/dirname_r.c
2013-01-03 22:28:59 +00:00
Martin Woodward
0470f8fc9d Add full license notice to bsearch code
The original BSD glibc code contains the notice as given at
http://opensource.apple.com/source/gcc/gcc-5666.3/libiberty/bsearch.c
and should be given in full along with the code.
2013-01-03 22:24:10 +00:00