git-add--interactive works only in top level

From: Reid Barton <hidden>
Date: 2016-06-15 22:43:56

When the working directory is not the top of the working tree, git- 
add--interactive fails silently and confusingly.  In this example,  
the working tree is rooted at ~/sandbox/foo and ~/sandbox/foo/bar/x  
is a file that's been edited.

rwbarton@homothety:~/sandbox/foo/bar$ git-add--interactive
            staged     unstaged path
   1:    unchanged        +1/-0 bar/x

*** Commands ***
   1: status       2: update       3: revert       4: add untracked
   5: patch        6: diff         7: quit         8: help
What now> 5
            staged     unstaged path
   1:    unchanged        +1/-0 bar/x
Patch update> 1

*** Commands ***
   1: status       2: update       3: revert       4: add untracked
   5: patch        6: diff         7: quit         8: help
What now>

Rather than returning to the main menu, git-add--interactive should  
have showed me a list of chunks.  It seems that the list of files is  
relative to the working tree root (which is sensible) but when git- 
add--interactive invokes git-diff-files it does not take this into  
account.  Perhaps git-diff-files should also complain when invoked as

git-diff-files -- non-existent-file-name

so it wouldn't have taken me half an hour to track this down.

Regards,
Reid Barton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help