git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git checkout under 1.7.6 does not properly list untracked files and aborts

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Sep 21, 2011, 10:28 UTC
Message-ID
<20110921102834.GA21353@duynguyen-vnpc>
In-Reply-To
<4E79AB5F.5020809@drmicha.warpmail.net>
On Wed, Sep 21, 2011 at 11:16:15AM +0200, Michael J Gruber wrote:
> Thanks. I can confirm that with the above patch, the code compiles and
> fails my test. So it's the earlier of the two commits which introduces this.

I was afraid some logic had gone horribly wrong. Turns out I did not catch up with unpack_trees() coding style and drop the error messages so "git checkout" in this case becomes "git checkout -q".

This patch should fix it. Need another look before I submit a real patch though.

diff --git a/unpack-trees.c b/unpack-trees.c
index cc616c3..79e9e88 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1102,12 +1102,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 			 */
 			if (ce->ce_flags & CE_ADDED &&
 			    verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))
-					return -1;
+				goto return_failed;
 
-			if (apply_sparse_checkout(ce, o)) {
-				ret = -1;
-				goto done;
-			}
+			if (apply_sparse_checkout(ce, o))
+				goto return_failed;
 			if (!ce_skip_worktree(ce))
 				empty_worktree = 0;
 
Previous: Michael J GruberNext: Nguyen Thai Ngoc Duy
Message 22 of 23 in “git checkout under 1.7.6 does not properly list untracked files and aborts”
  1. Joshua JensenSep 9, 2011
  2. Joshua JensenSep 19, 2011
  3. Joshua JensenSep 19, 2011
  4. Michael J GruberSep 20, 2011
  5. Joshua JensenSep 20, 2011
  6. Michael J GruberSep 21, 2011
  7. 0/3 read-tree cleanupsMichael J Gruber, Sep 21, 2011
  8. Michael J GruberSep 21, 2011
  9. Junio C HamanoSep 21, 2011
  10. 1/3 unpack-trees: print "Aborting" to stderrMichael J Gruber, Sep 21, 2011
  11. Junio C HamanoSep 21, 2011
  12. Junio C HamanoSep 21, 2011
  13. Michael J GruberSep 22, 2011
  14. 2/3 git-read-tree.txt: language and typography fixesMichael J Gruber, Sep 21, 2011
  15. 3/3 git-read-tree.txt: correct sparse-checkout and skip-worktree descriptionMichael J Gruber, Sep 21, 2011
  16. Nguyen Thai Ngoc DuySep 21, 2011
  17. Michael J GruberSep 21, 2011
  18. Nguyen Thai Ngoc DuySep 21, 2011
  19. Michael J GruberSep 21, 2011
  20. Nguyen Thai Ngoc DuySep 21, 2011
  21. Michael J GruberSep 21, 2011
  22. Nguyen Thai Ngoc DuySep 21, 2011
  23. Nguyen Thai Ngoc DuySep 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.