aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Implement 'git checkout --patch'Thomas Rast2009-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a --patch mode for git-checkout. In the index usage git checkout --patch -- [files...] it lets the user discard edits from the <files> at the granularity of hunks (by selecting hunks from 'git diff' and then reverse applying them to the worktree). We also accept a revision argument. In the case git checkout --patch HEAD -- [files...] we offer hunks from the difference between HEAD and the worktree, and reverse applies them to both index and worktree, allowing you to discard staged changes completely. In the non-HEAD usage git checkout --patch <revision> -- [files...] it offers hunks from the difference between the worktree and <revision>. The chosen hunks are then applied to both index and worktree. The application to worktree and index is done "atomically" in the sense that we first check if the patch applies to the index (it should always apply to the worktree). If it does not, we give the user a choice to either abort or apply to the worktree anyway. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Implement 'git reset --patch'Thomas Rast2009-08-15
| | | | | | | | | | | | | | | | | | This introduces a --patch mode for git-reset. The basic case is git reset --patch -- [files...] which acts as the opposite of 'git add --patch -- [files...]': it offers hunks for *un*staging. Advanced usage is git reset --patch <revision> -- [files...] which offers hunks from the diff between the index and <revision> for forward application to the index. (That is, the basic case is just <revision> = HEAD.) Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-add: refactor the meat of interactive_add()Thomas Rast2009-08-14
| | | | | | | | | This moves the call setup for 'git add--interactive' to a separate function, as other users will call it without running validate_pathspec() first. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a small patch-mode testing libraryThomas Rast2009-08-14
| | | | | | | | | | | The tests for {reset,commit,stash} -p will frequently have to set both worktree and index states to known values, and verify that the outcome (again both worktree and index) are what was expected. Add a small helper library that lets us do these tasks more easily. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-apply--interactive: Refactor patch mode codeThomas Rast2009-08-14
| | | | | | | | | | | | | | This makes some aspects of the 'git add -p' loop configurable (within the code), so that we can later reuse git-add--interactive for other similar tools. Most fields are fairly straightforward, but APPLY gets a subroutine (instead of just a string a la 'apply --cached') so that we can handle 'checkout -p', which will need to atomically apply the patch twice (index and worktree). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2009-07-25
|\ | | | | | | | | | | | | | | * maint: t8005: Nobody writes Russian in shift_jis Conflicts: t/t8005-blame-i18n.sh
| * t8005: Nobody writes Russian in shift_jisJunio C Hamano2009-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The second and third tests of this script expected that Russian strings are converted between ISO-8859-5 and Shift_JIS in the "blame --porcelain" format output correctly. Sure, many platforms may convert between such a combination, but that is only because one of the base character set of Shift_JIS, JIS X 0208, defines codepoints for Russian characters (among others); I do not think anybody uses Shift_JIS when seriously writing Russian, and it is perfectly understandable if iconv() libraries on some platforms fail converting between this combination, as it does not matter in reality. This patch changes the test to verify Japanese strings are converted correctly between EUC-JP and Shift_JIS in the same procedure. The point of the test is not about verifying the platform's iconv() library, but to see if "git blame" makes correct iconv() library calls when it should. We could instead use ISO-8859-5 and KOI8-R as the combination, because they are both meant to represent Russian, in order to make this test meaningful on more platforms, but we already use Shift_JIS vs EUC-JP combinations to test other programs in our test suite, so this combination is safer from the point of view of the portability. Besides, I do not read nor write Russian; sorry ;-) This change allows tests to pass on my (friend's) Solaris 5.11 box. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2009-07-25
|\ \ | |/ | | | | | | * maint: Fix severe breakage in "git-apply --whitespace=fix"
| * Fix severe breakage in "git-apply --whitespace=fix"Junio C Hamano2009-07-25
| | | | | | | | | | | | | | 735c674 (Trailing whitespace and no newline fix, 2009-07-22) completely broke --whitespace=fix, causing it to lose all the empty lines in a patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Update release notes for 1.6.4Junio C Hamano2009-07-25
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'js/maint-graft-unhide-true-parents'Junio C Hamano2009-07-25
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * js/maint-graft-unhide-true-parents: git repack: keep commits hidden by a graft Add a test showing that 'git repack' throws away grafted-away parents Conflicts: git-repack.sh
| * | git repack: keep commits hidden by a graftJohannes Schindelin2009-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have grafts that pretend that a given commit has different parents than the ones recorded in the commit object, it is dangerous to let 'git repack' remove those hidden parents, as you can easily remove the graft and end up with a broken repository. So let's play it safe and keep those parent objects and everything that is reachable by them, in addition to the grafted parents. As this behavior can only be triggered by git pack-objects, and as that command handles duplicate parents gracefully, we do not bother to cull duplicated parents that may result by using both true and grafted parents. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Add a test showing that 'git repack' throws away grafted-away parentsBjörn Steinbrink2009-07-23
| | | | | | | | | | | | | | | | | | Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'av/maint-config-reader'Junio C Hamano2009-07-25
|\ \ \ | | | | | | | | | | | | | | | | | | | | * av/maint-config-reader: After renaming a section, print any trailing variable definitions Make section_name_match start on '[', and return the length on success
| * | | After renaming a section, print any trailing variable definitionsAlex Vandiver2009-07-24
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Alex Vandiver <alex@chmrr.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Make section_name_match start on '[', and return the length on successAlex Vandiver2009-07-24
| |/ / | | | | | | | | | | | | Signed-off-by: Alex Vandiver <alex@chmrr.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/maint-send-email-alias-loop'Junio C Hamano2009-07-25
|\ \ \ | | | | | | | | | | | | | | | | * jk/maint-send-email-alias-loop: send-email: detect cycles in alias expansion
| * | | send-email: detect cycles in alias expansionJeff King2009-07-24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous code, an alias cycle like: $ echo 'alias a b' >aliases $ echo 'alias b a' >aliases $ git config sendemail.aliasesfile aliases $ git config sendemail.aliasfiletype mutt would put send-email into an infinite loop. This patch detects the situation and complains to the user. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Show the presence of untracked files in the bash prompt.Daniel Trstenjak2009-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the envvar GIT_PS1_SHOWUNTRACKEDFILES to 'git-completion.bash'. When set to a nonempty value, then the char '%' will be shown next to the branch name in the bash prompt. Signed-off-by: Daniel Trstenjak <daniel.trstenjak@science-computing.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2009-07-24
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: SunOS grep does not understand -C<n> nor -e Fix export_marks() error handling. git branch: clean up detached branch handling git branch: avoid unnecessary object lookups git branch: fix performance problem do_one_ref(): null_sha1 check is not about broken ref Conflicts: Makefile
| * | SunOS grep does not understand -C<n> nor -eJunio C Hamano2009-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first "grep -C1" test in t7002 does not pass on my SunOS-5.11-i86pc, and that is not because our way to spawn external grep is broken, but because the native grep does not understand -C<n>. It turns out that Peff was also using this option himself because our Makefile doesn't do that automatically. Brandon Casey uses SUNWspro compiler without having to set this, and it turns out that the compiler does not define preprocessor macro __unix__ which made him always use the built-in grep, never an external one. Let's be more explicit and say that we do not use external grep on Suns. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Fix export_marks() error handling.Matthias Andree2009-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't leak one FILE * on error per export_marks() call. Found with cppcheck and reported by Martin Ettl. - Abort the potentially long for(;idnums.size;) loop on write errors. - Record error if fprintf() fails for reasons not required to set the stream error indicator, such as ENOMEM. - Add a trailing full-stop to error message when fopen() fails. Signed-off-by: Matthias Andree <matthias.andree@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git branch: clean up detached branch handlingLinus Torvalds2009-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the 'show detached branch info' a routine of its own. And in the process, avoid the object lookup that is unnecessary if the current branch isn't detached. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git branch: avoid unnecessary object lookupsLinus Torvalds2009-07-23
| | | | | | | | | | | | | | | | | | | | | | | | They can be expensive in the cold-cache case, so don't bother looking up the commits for all branches unless we really need them for some reason. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git branch: fix performance problemLinus Torvalds2009-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'git branch' looks at _all_ the refs, and verifies them. Which means that during cold-cache situations with a slow disk (and lots of tags, for example) it can take several very annoying seconds (7.5s according to a report by Carlos R. Mafra). This avoids most of it by simply doing the filtering before looking up the commits, by using the "raw" version of for_each_ref. Reported-by: Carlos R. Mafra <crmafra2@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | do_one_ref(): null_sha1 check is not about broken refJunio C Hamano2009-07-22
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f8948e2 (remote prune: warn dangling symrefs, 2009-02-08) introduced a more dangerous variant of for_each_ref() family that skips the check for dangling refs, but it also made another unrelated check optional by mistake. The check to see if a ref points at 0{40} is not about brokenness, but is about a possible future plan to represent a deleted ref by writing 40 "0" in a loose ref when there is a stale version of the same ref already in .git/packed-refs, so that we can implement deletion of a ref without having to rewrite the packed refs file excluding the ref being deleted. This check has to live outside of the conditional. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git svn: fix shallow clone when upstream revision is too newEric Wong2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Ka-Hing Cheung for the initial bug report and patch: > git-svn uses $ra->get_latest_revnum to find out the latest > revision, but that can be problematic, because get_latest_revnum > returns the latest revnum in the entire repository, not > restricted by whatever URL you used to construct $ra. So if you > do git svn clone -r HEAD svn://blah/blah/trunk, it won't work if > the latest checkin is in one of the branches (it will try to > fetch a rev that doesn't exist in trunk, making the clone > useless). Relying on SVN::Core::INVALID_REVNUM (-1) as the "start" argument to SVN::Ra::get_log() proved unreliable with http(s) URLs so the result of SVN::Ra::get_latest_revnum() is used as the "start" argument instead. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | configure.ac: properly unset NEEDS_SSL_WITH_CRYPTO when sha1 func is missingv1.6.4-rc2Brandon Casey2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | The empty assignment NEEDS_SSL_WITH_CRYPTO= was mistakenly paired with the assignment NEEDS_SSL_WITH_CRYPTO=YesPlease in the "action-if-found" parameter of the AC_CHECK_LIB macro. The empty assignment was intended for the "action-if-not-found" section, since in that case, the necessary sha1 hash function was not found and the internal sha1 implementation will be used instead. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | janitor: useless checks before freePierre Habouzit2009-07-22
| | | | | | | | | | Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | janitor: add DIV_ROUND_UP and use it.Pierre Habouzit2009-07-22
| | | | | | | | | | Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | refactor: use bitsizeof() instead of 8 * sizeof()Pierre Habouzit2009-07-22
| | | | | | | | | | Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | janitor: use NULL and not 0 for pointers.Pierre Habouzit2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brought to you thanks to coccinelle: ---8<---- @@ expression *E; @@ ( E == - 0 + NULL | E != - 0 + NULL | E = - 0 + NULL ) @@ identifier f; type T; @@ T *f(...) { <... - return 0; + return NULL; ...> } --->8---- There are a lot more hits in compat/nedmallox and compat/regex but these are borrowed code we rather do not want to maintain our own forks for, and this patch refrains from touching them. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git stash: modernize use of "dashed" git-XXX callsMartin Koegler2009-07-22
| | | | | | | | | | | | | | | | Replace remaining git-XXX calls with git XXX. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Acked-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Improve doc for format-patch threading options.Yann Dirson2009-07-22
| | | | | | | | | | | | | | | | This hopefully makes the relationship between threading options of format-patch and send-email easier to grasp. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | List send-email config options in config.txt.Yann Dirson2009-07-22
| | | | | | | | | | | | | | | | Also mention deprecated aliases that do not appear in the send-email manpage. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | configure.ac: rework/fix the NEEDS_RESOLV and NEEDS_LIBGEN testsBrandon Casey2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "action" parameters for these two tests were supplied incorrectly for the way the tests were implemented. The tests check whether a program which calls hstrerror() or basename() successfully links when -lresolv or -lgen are used, respectively. A successful linking would result in NEEDS_RESOLV or NEEDS_LIBGEN being unset, and failure would result in setting the respective variable. Aside from that issue, the tests did not handle the case where neither library was necessary for accessing the functions in question. So solve both of these issues by re-working the two tests so that their form is like the NEEDS_SOCKET test which attempts to link with just the c library, and if it fails then assumes that the additional library is necessary and sets the appropriate variable. Also an entry in the config.mak.in file is necessary for the NEEDS_LIBGEN variable to appear in the config.mak.autogen file with the value assigned by the configure script. Without it, the generated shell script would contain a snippet like this: for ac_lib in ; do ... which is incorrect. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2009-07-22
|\ \ | |/ | | | | | | | | | | * maint: Trailing whitespace and no newline fix diff --cc: a lost line at the beginning of the file is shown incorrectly combine-diff.c: fix performance problem when folding common deleted lines
| * Trailing whitespace and no newline fixSZEDER Gábor2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | If a patch adds a new line to the end of a file and this line ends with one trailing whitespace character and has no newline, then '--whitespace=fix' currently does not remove that trailing whitespace. This patch fixes this by removing the check for trailing whitespace at the end of the line at a hardcoded offset which does not take the eventual absence of newline into account. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * diff --cc: a lost line at the beginning of the file is shown incorrectlyJunio C Hamano2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | When combine-diff inspected the diff from one parent to the merge result, it misinterpreted a header in the form @@ -l,k +0,0 @@. This hunk header means that K lines were removed from the beginning of the file, so the lost lines must be queued to the sline that represents the first line of the merge result, but we incremented our pointer incorrectly and ended up queuing it to the second line, which in turn made the lossage appear _after_ the first line. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * combine-diff.c: fix performance problem when folding common deleted linesJunio C Hamano2009-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a deleted line in a patch with the parent we are looking at, the append_lost() function finds the same line among a run of lines that were deleted from the same location by patches from parents we previously checked. This is so that patches with two parents @@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@ one one -two -two three three -quatro -fyra +four +four can be coalesced into this sequence, reusing one line that describes the removal of "two" for both parents. @@@ -1,4 -1,4 +1,3 @@@ one --two three - quatro -frya ++four While reading the second patch (that removes "two" and then "fyra"), after finding where removal of the "two" matches, we need to find existing removal of "fyra" (if exists) in the removal list, but the match has to happen after all the existing matches (in this case "two"). The code used a naïve O(n^2) algorithm to compute this by scanning the whole removal list over and over again. This patch remembers where the next scan should be started in the existing removal list to avoid this. Noticed by Linus Torvalds. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git svn: fix reparenting when ugly http(s) URLs are usedEric Wong2009-07-19
| | | | | | | | | | | | | | | | | | | | | | | | Mishandling of http(s) in need of escaping was causing t9118-git-svn-funky-branch-names to fail when SVN_HTTPD_PORT was defined. This bug was exposed in (but not caused by) commit 0b2af457a49e3b00d47d556d5301934d27909db8 (Fix branch detection when repository root is inaccessible) Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | git svn: rename tests that had conflicting numbersEric Wong2009-07-19
| | | | | | | | | | | | | | | | | | | | Some unrelated tests were developed simultaneously and resulted in test numbers conflicting. To avoid difficulty when referring to tests via the "tXXXX" convention, rename the newer tests. Suggested by Marc Branchaud. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | Updates to draft release notes to 1.6.4Junio C Hamano2009-07-18
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | push: do not give big warning when no preference is configuredJunio C Hamano2009-07-18
| | | | | | | | | | | | | | | | | | | | If the message said "we will be changing the default in the future, so this is to warn people who want to keep the current default what to do", it would have made some sense, but as it stands, the message is merely an unsolicited advertisement for a new feature, which it is not helpful at all. Squelch it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber2009-07-18
| | | | | | | | | | | | | | | | | | | | | | 'git log --no-walk' sorts commits by commit time whereas 'git show' does not (it leaves them as given on the command line). Document this by two tests so that we never forget why ba1d450 (Tentative built-in "git show", 2006-04-15) introduced it and 8e64006 (Teach revision machinery about --no-walk, 2007-07-24) exposed it as an option argument. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | cvsexportcommit: reorder tests to quiet intermittent failureMike Ralphson2009-07-18
| | | | | | | | | | | | | | | | | | | | Reorder tests introduced in fef3a7cc and 54d5cc0e so an intermittent but unimportant failure on the CVS side related to the former does not interfere with what is actually being tested. Signed-off-by: Mike Ralphson <mike@abacus.co.uk> Tested-by: Tommy Nordgren <tommy.nordgren@comhem.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2009-07-18
|\ \ | |/ | | | | | | | | | | * maint: checkout -f: deal with a D/F conflict entry correctly sha1_name.c: avoid unnecessary strbuf_release refs.c: release file descriptor on error return
| * checkout -f: deal with a D/F conflict entry correctlyJunio C Hamano2009-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we switch branches with "checkout -f", unpack_trees() feeds two cache_entries to oneway_merge() function in its src[] array argument. The zeroth entry comes from the current index, and the first entry represents what the merge result should be, taken from the tree recorded in the commit we are switching to. When we have a blob (either regular file or a symlink) in the index and in the work tree at path "foo", and the switched-to tree has "foo/bar", i.e. "foo" becomes a directory, src[0] is obviously that blob currently registered at "foo". Even though we do not have anything at "foo" in the switched-to tree, src[1] is _not_ NULL in this case. The unpack_trees() machinery places a special marker df_conflict_entry to signal that no blob exists at "foo", but it will become a directory that may have somthing underneath it (namely "foo/bar"), so a usual 3-way merge can notice the situation. But oneway_merge() codepath failed to notice this and passed the special marker directly to merged_entry(). This happens to remove the "foo" in the end because the df_conflict_entry does not have any name (hence the "error" message) and its addition in add_index_entry() is rejected, but it is wrong. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
| * sha1_name.c: avoid unnecessary strbuf_releaseBrandon Casey2009-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we fall back to a standard for_each_reflog_ent() after failing to find the nth branch switch (or if we had a short reflog) with the call to for_each_recent_reflog_ent(), we do not need to free the memory allocated for our strbuf's since a strbuf_reset() will be performed in grab_nth_branch_switch() before assigning to the entry. Plus, the strbuf_release() negates the non-zero hint we initially gave to strbuf_init() just above these lines. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * refs.c: release file descriptor on error returnBrandon Casey2009-07-16
| | | | | | | | | | Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>