Skip to contentSkip to conversation

Bug in diff header generation

PATCH Matthias Kestenholz 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I've encountered a small error in the diff header generation when diffing against files which are not tracked by git:

[13:49] mk@crap ~/Projects/git > git diff git.c ~/bin/viname|head

home/mk/bin/viname renamed from git.c +0 -3
old mode 100644
new mode 100755
index 008e016..b64857e
@@ -1,416 +1,106 @@
-#include "builtin.h"
-#include "exec_cmd.h"
-#include "cache.h"

[13:49] mk@crap ~/Projects/git > git diff HEAD:git.c ~/bin/viname|head

home/mk/bin/viname +0 -5
index 008e016..b64857e 100755
@@ -1,416 +1,106 @@
-#include "builtin.h"
-#include "exec_cmd.h"
-#include "cache.h"
-#include "quote.h"
-
 
 

When a revision is specified, git-diff prints a/home/mk/bin/viname instead of a/git.c

Because of my final exams I've got no time to look into it right now.

Matthias

#1 lore raw

Hi,

home/mk/bin/viname

Quoted 2 lines · Matthias Kestenholz

[13:49] mk@crap ~/Projects/git > git diff HEAD:git.c ~/bin/viname|head

home/mk/bin/viname +0 -0

This is intended behaviour. You don't want a Git object name as a file specifier, because you cannot edit a Git object.

Hth,
Dscho